This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REPO=$HOME/.m2/repository | |
CP=$REPO/asm/asm/2.2.3/asm-2.2.3.jar | |
CP=$CP:$REPO/asm/asm-attrs/2.2.3/asm-attrs-2.2.3.jar | |
CP=$CP:$REPO/asm/asm-util/2.2.3/asm-util-2.2.3.jar | |
java -cp $CP org.objectweb.asm.util.ASMifierClassVisitor $@ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.interceptor.AroundInvoke; | |
import javax.interceptor.InvocationContext; | |
public class InvocationContextPropagator { | |
private final static ThreadLocal context = new ThreadLocal(); | |
@AroundInvoke | |
public Object intercept(InvocationContext newContext) throws Exception { | |
// Get the previous InvocationContext | |
InvocationContext oldContext = context.get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Stateless | |
@EJBs({ | |
@EJB(name = "myFooEjb", beanInterface = FooRemote.class), | |
@EJB(name = "myBarEjb", beanInterface = BarRemote.class) | |
}) | |
public class MyEjbRemoteRefBean implements MyBeanInterface { | |
@EJB | |
private BarRemote myBarEjb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Stateless | |
@EJB(name = "myFooEjb", beanInterface = FooRemote.class) | |
@EJB(name = "myBarEjb", beanInterface = BarRemote.class) | |
public class MyEjbRemoteRefBean implements MyBeanInterface { | |
@EJB | |
private BarRemote myBarEjb; | |
public void someBusinessMethod() throws Exception { | |
if (myBarEjb == null) throw new NullPointerException("myBarEjb not injected"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Stateless | |
@EJB(name = "myFooEjb", beanInterface = FooRemote.class) | |
public class MyEjbRemoteRefBean implements MyBeanInterface { | |
public List<FooRemote> giveMeManyInstances(int number) throws Exception { | |
List<FooRemote> beans = new ArrayList<FooRemote>(); | |
// Both can be looked up from JNDI as well | |
InitialContext context = new InitialContext(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
metadata-complete="false" | |
version="2.5"> | |
<ejb-ref> | |
<ejb-ref-name>EntityBeansJobStore</ejb-ref-name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
metadata-complete="false" | |
version="2.5"> | |
<ejb-ref> | |
<ejb-ref-name>EntityBeansJobStore</ejb-ref-name> |