JBossWS SVN: r11892 - stack/native/tags.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-30 06:15:10 -0400 (Tue, 30 Mar 2010)
New Revision: 11892
Added:
stack/native/tags/jbossws-native-3.3.0.CR1.SP1/
Log:
tagging new NATIVE release
Copied: stack/native/tags/jbossws-native-3.3.0.CR1.SP1 (from rev 11891, stack/native/trunk)
14 years, 9 months
JBossWS SVN: r11891 - framework/tags.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-30 06:08:15 -0400 (Tue, 30 Mar 2010)
New Revision: 11891
Added:
framework/tags/jbossws-framework-3.3.0.CR1.SP1/
Log:
tagging new FRAMEWORK release
Copied: framework/tags/jbossws-framework-3.3.0.CR1.SP1 (from rev 11890, framework/trunk)
14 years, 9 months
JBossWS SVN: r11890 - common/tags.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-30 05:55:36 -0400 (Tue, 30 Mar 2010)
New Revision: 11890
Added:
common/tags/jbossws-common-1.3.0.CR1.SP1/
Log:
tagging new COMMON release
Copied: common/tags/jbossws-common-1.3.0.CR1.SP1 (from rev 11889, common/trunk)
14 years, 9 months
JBossWS SVN: r11889 - spi/tags.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-30 05:49:20 -0400 (Tue, 30 Mar 2010)
New Revision: 11889
Added:
spi/tags/jbossws-spi-1.3.0.CR1.SP1/
Log:
tagging new SPI release
Copied: spi/tags/jbossws-spi-1.3.0.CR1.SP1 (from rev 11888, spi/trunk)
14 years, 9 months
JBossWS SVN: r11888 - in stack/native/trunk/modules/core/src/main/java/org/jboss/ws: extensions/wsrm/server and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-30 05:20:35 -0400 (Tue, 30 Mar 2010)
New Revision: 11888
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java
Log:
[JBWS-2970] endpoints will provide associated JNDI context, not deployment time hack
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2010-03-30 09:06:47 UTC (rev 11887)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2010-03-30 09:20:35 UTC (rev 11888)
@@ -28,6 +28,7 @@
import java.util.Map;
import java.util.Set;
+import javax.naming.Context;
import javax.xml.namespace.QName;
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.HandlerResolver;
@@ -46,6 +47,8 @@
import org.jboss.wsf.common.handler.GenericHandler;
import org.jboss.wsf.common.handler.GenericSOAPHandler;
import org.jboss.wsf.common.injection.InjectionHelper;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.EndpointAssociation;
import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -171,7 +174,12 @@
if (handler instanceof GenericSOAPHandler)
((GenericSOAPHandler)handler).setHeaders(soapHeaders);
- InjectionHelper.injectResources(handler, injections);
+ if (injections != null)
+ {
+ Endpoint ep = EndpointAssociation.getEndpoint();
+ Context ctx = ep == null ? null : ep.getJNDIContext();
+ InjectionHelper.injectResources(handler, injections, ctx);
+ }
InjectionHelper.callPostConstructMethod(handler);
addHandler(jaxwsMetaData, handler, type);
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java 2010-03-30 09:06:47 UTC (rev 11887)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/server/RMInvocationHandler.java 2010-03-30 09:20:35 UTC (rev 11888)
@@ -28,6 +28,8 @@
import java.util.List;
import java.util.Map;
+import javax.naming.Context;
+import javax.naming.NamingException;
import javax.xml.namespace.QName;
import javax.xml.ws.addressing.AddressingBuilder;
import javax.xml.ws.addressing.AddressingProperties;
@@ -372,4 +374,10 @@
return this.delegate;
}
+ @Override
+ public Context getJNDIContext(Endpoint ep) throws NamingException
+ {
+ return this.delegate.getJNDIContext(ep);
+ }
+
}
14 years, 9 months
JBossWS SVN: r11887 - in container/jboss50/branches: jbossws-jboss501/src/main/java/org/jboss/webservices/integration/injection and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-30 05:06:47 -0400 (Tue, 30 Mar 2010)
New Revision: 11887
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
container/jboss50/branches/jbossws-jboss510/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/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2010-03-30 08:54:52 UTC (rev 11886)
+++ container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2010-03-30 09:06:47 UTC (rev 11887)
@@ -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/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2010-03-30 08:54:52 UTC (rev 11886)
+++ container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2010-03-30 09:06:47 UTC (rev 11887)
@@ -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;
@@ -44,7 +42,6 @@
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.common.injection.resolvers.ResourceReferenceResolver;
-import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -53,6 +50,7 @@
import org.jboss.wsf.spi.metadata.injection.InjectionMetaData;
import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
import org.jboss.wsf.spi.metadata.injection.ReferenceResolver;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
/**
* Deployment aspect that builds injection meta data.
@@ -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/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2010-03-30 08:54:52 UTC (rev 11886)
+++ container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2010-03-30 09:06:47 UTC (rev 11887)
@@ -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.
Modified: container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
===================================================================
--- container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2010-03-30 08:54:52 UTC (rev 11886)
+++ container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2010-03-30 09:06:47 UTC (rev 11887)
@@ -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/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
===================================================================
--- container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2010-03-30 08:54:52 UTC (rev 11886)
+++ container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2010-03-30 09:06:47 UTC (rev 11887)
@@ -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;
@@ -44,7 +42,6 @@
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.common.injection.resolvers.ResourceReferenceResolver;
-import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -53,6 +50,7 @@
import org.jboss.wsf.spi.metadata.injection.InjectionMetaData;
import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
import org.jboss.wsf.spi.metadata.injection.ReferenceResolver;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
/**
* Deployment aspect that builds injection meta data.
@@ -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/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
===================================================================
--- container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2010-03-30 08:54:52 UTC (rev 11886)
+++ container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2010-03-30 09:06:47 UTC (rev 11887)
@@ -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.
14 years, 9 months
JBossWS SVN: r11886 - in container/jboss60/branches/jbossws-jboss600M2/src/main/java/org/jboss/webservices/integration: injection and 1 other directories.
by jbossws-commits@lists.jboss.org
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.
14 years, 9 months
JBossWS SVN: r11885 - framework/trunk/src/main/java/org/jboss/wsf/framework/deployment.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-30 04:49:18 -0400 (Tue, 30 Mar 2010)
New Revision: 11885
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
Log:
[JBWS-2970] every endpoint will provide associated JNDI context at runtime, not at deployment time
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2010-03-30 08:46:06 UTC (rev 11884)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2010-03-30 08:49:18 UTC (rev 11885)
@@ -27,7 +27,10 @@
import javax.management.ObjectName;
import javax.management.MalformedObjectNameException;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import org.jboss.wsf.common.injection.InjectionException;
import org.jboss.wsf.common.injection.PreDestroyHolder;
import org.jboss.wsf.spi.deployment.AbstractExtensible;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -65,9 +68,6 @@
DefaultEndpoint(String targetBean)
{
- //if(null==targetBean)
- // throw new IllegalArgumentException("targetBean name cannot be null");
-
this.targetBean = targetBean;
this.state = EndpointState.UNDEFINED;
}
@@ -106,22 +106,13 @@
public synchronized Class<?> getTargetBeanClass()
{
+ if (targetBean == null)
+ throw new IllegalStateException("Target bean not set");
if (targetBeanClass != null)
return targetBeanClass;
- if (targetBean == null)
- throw new IllegalStateException("Target bean not set");
ClassLoader classLoader = service.getDeployment().getRuntimeClassLoader();
- if (classLoader == null)
- {
- // TODO: IMO this is an exception
- classLoader = service.getDeployment().getInitialClassLoader();
- }
-
- if (classLoader == null)
- throw new IllegalStateException("Deployment classloader not set");
-
try
{
targetBeanClass = classLoader.loadClass(targetBean);
@@ -130,6 +121,7 @@
{
throw new WSFDeploymentException(ex);
}
+
return targetBeanClass;
}
@@ -315,4 +307,23 @@
}
}
}
+
+ @Override
+ public Context getJNDIContext()
+ {
+ Context retVal = null;
+
+ try
+ {
+ retVal = this.getInvocationHandler().getJNDIContext(this);
+ }
+ catch (NamingException e)
+ {
+ final String message = "Cannot get JNDI context";
+ InjectionException.rethrow(message, e);
+ }
+
+ return retVal;
+ }
+
}
14 years, 9 months