Author: richard.opalka(a)jboss.com
Date: 2010-03-30 04:54:52 -0400 (Tue, 30 Mar 2010)
New Revision: 11886
Modified:
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
Log:
[JBWS-2970] every endpoint will provide associated JNDI context at runtime, not at
deployment time
Modified:
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2010-03-30
08:49:18 UTC (rev 11885)
+++
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2010-03-30
08:54:52 UTC (rev 11886)
@@ -27,7 +27,6 @@
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-import javax.naming.Context;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
@@ -177,16 +176,6 @@
}
/**
- * Returns JNDI context associated with EJB container.
- *
- * @return JNDI context
- */
- public Context getContext()
- {
- return this.ejbContainer.getEnc();
- }
-
- /**
* Returns EJB name.
*
* @return name
Modified:
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2010-03-30
08:49:18 UTC (rev 11885)
+++
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2010-03-30
08:54:52 UTC (rev 11886)
@@ -31,8 +31,6 @@
import javax.annotation.Resource;
import javax.ejb.EJB;
-import javax.naming.Context;
-import javax.naming.NamingException;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
@@ -62,9 +60,6 @@
public final class InjectionMetaDataDeploymentAspect extends AbstractDeploymentAspect
{
- /** EJB 3 JNDI prefix. */
- private static final String EJB3_JNDI_PREFIX = "java:env/";
-
/** Resolver handling @Resource injections. */
private static final ReferenceResolver RESOURCE_RESOLVER = new
ResourceReferenceResolver();
@@ -125,7 +120,7 @@
for (Endpoint endpoint : dep.getService().getEndpoints())
{
// build POJO injections meta data
- final InjectionsMetaData injectionsMD =
this.buildInjectionsMetaData(envEntriesMD, resolvers, null);
+ final InjectionsMetaData injectionsMD =
this.buildInjectionsMetaData(envEntriesMD, resolvers);
// associate injections meta data with POJO endpoint
endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
@@ -146,9 +141,7 @@
// build EJB 3 injections meta data
final EnvironmentEntriesMetaData ejbEnvEntries =
this.getEnvironmentEntries(ejbName, unit);
- final Context jndiContext = this.getJndiContext(container);
- final InjectionsMetaData injectionsMD =
this.buildInjectionsMetaData(ejbEnvEntries, resolvers,
- jndiContext);
+ final InjectionsMetaData injectionsMD =
this.buildInjectionsMetaData(ejbEnvEntries, resolvers);
// associate injections meta data with EJB 3 endpoint
final Endpoint endpoint = dep.getService().getEndpointByName(ejbName);
@@ -174,24 +167,6 @@
}
/**
- * Returns JNDI context associated with EJB 3 container.
- *
- * @param container EJB 3 container
- * @return JNDI context
- */
- private Context getJndiContext(final WebServiceDeclaration container)
- {
- try
- {
- return (Context)
container.getContext().lookup(InjectionMetaDataDeploymentAspect.EJB3_JNDI_PREFIX);
- }
- catch (NamingException ne)
- {
- throw new RuntimeException(ne);
- }
- }
-
- /**
* Returns reference resolvers container.
*
* @param unit deployment unit
@@ -213,15 +188,14 @@
* @param envEntriesMD environment entries meta data
* @param resolvers known annotation resolvers
* @param jndiContext JNDI context to be propagated
- * @return injections meta data
*/
private InjectionsMetaData buildInjectionsMetaData(final EnvironmentEntriesMetaData
envEntriesMD,
- final Map<Class<? extends Annotation>, ReferenceResolver> resolvers,
final Context jndiContext)
+ final Map<Class<? extends Annotation>, ReferenceResolver>
resolvers)
{
final List<InjectionMetaData> injectionMD = new
LinkedList<InjectionMetaData>();
injectionMD.addAll(this.buildInjectionMetaData(envEntriesMD));
- return new InjectionsMetaData(injectionMD, resolvers, jndiContext);
+ return new InjectionsMetaData(injectionMD, resolvers);
}
/**
Modified:
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2010-03-30
08:49:18 UTC (rev 11885)
+++
container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2010-03-30
08:54:52 UTC (rev 11886)
@@ -23,8 +23,11 @@
import java.lang.reflect.Method;
+import javax.naming.Context;
+import javax.naming.NamingException;
import javax.xml.ws.WebServiceException;
+import org.jboss.ejb3.EJBContainer;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.common.invocation.AbstractInvocationHandler;
import org.jboss.wsf.spi.SPIProvider;
@@ -44,6 +47,8 @@
*/
final class InvocationHandlerEJB3 extends AbstractInvocationHandler
{
+ /** EJB3 JNDI context. */
+ private static final String EJB3_JNDI_PREFIX = "java:env/";
/** MC kernel controller. */
private final IoCContainerProxy iocContainer;
@@ -131,6 +136,12 @@
this.handleInvocationException(t);
}
}
+
+ public Context getJNDIContext(final Endpoint ep) throws NamingException
+ {
+ final EJBContainer ejb3Container = (EJBContainer)getEjb3Container();
+ return (Context)ejb3Container.getEnc().lookup(EJB3_JNDI_PREFIX);
+ }
/**
* EJB3 invocation callback allowing EJB 3 beans to access Web Service invocation
properties.
Show replies by date