[jboss-cvs] JBossAS SVN: r87927 - in branches/Branch_5_x: webservices/src/main/org/jboss/wsf/container/jboss50/deployer and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Apr 28 03:23:51 EDT 2009
Author: richard.opalka at jboss.com
Date: 2009-04-28 03:23:51 -0400 (Tue, 28 Apr 2009)
New Revision: 87927
Modified:
branches/Branch_5_x/component-matrix/pom.xml
branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/deployer/WebServiceDeployerEJB.java
branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java
branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java
branches/Branch_5_x/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml
Log:
[JBWS-2074][JBWS-2631] fixing AS integration layer
Modified: branches/Branch_5_x/component-matrix/pom.xml
===================================================================
--- branches/Branch_5_x/component-matrix/pom.xml 2009-04-28 07:08:45 UTC (rev 87926)
+++ branches/Branch_5_x/component-matrix/pom.xml 2009-04-28 07:23:51 UTC (rev 87927)
@@ -33,10 +33,10 @@
<version.javax.faces>1.2_12</version.javax.faces>
<version.jboss.jaxr>1.2.1.GA</version.jboss.jaxr>
<version.jboss.jbossts>4.6.0.CR1</version.jboss.jbossts>
- <version.jboss.jbossws-common>1.0.10.GA</version.jboss.jbossws-common>
- <version.jboss.jbossws-framework>3.1.1.GA</version.jboss.jbossws-framework>
- <version.jboss.jbossws-spi>1.1.1.GA</version.jboss.jbossws-spi>
- <version.jboss.jbossws>3.1.1.GA</version.jboss.jbossws>
+ <version.jboss.jbossws-common>1.0.11.CR1</version.jboss.jbossws-common>
+ <version.jboss.jbossws-framework>3.1.2.CR1</version.jboss.jbossws-framework>
+ <version.jboss.jbossws-spi>1.1.2.CR1</version.jboss.jbossws-spi>
+ <version.jboss.jbossws>3.1.2.CR1</version.jboss.jbossws>
<version.jboss.jms-integration-tests>1.0.1.GA</version.jboss.jms-integration-tests>
<version.jboss.messaging>1.4.3.GA</version.jboss.messaging>
<version.jboss.web>2.1.3.GA</version.jboss.web>
Modified: branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/deployer/WebServiceDeployerEJB.java
===================================================================
--- branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/deployer/WebServiceDeployerEJB.java 2009-04-28 07:08:45 UTC (rev 87926)
+++ branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/deployer/WebServiceDeployerEJB.java 2009-04-28 07:23:51 UTC (rev 87927)
@@ -27,6 +27,7 @@
import java.util.List;
import javax.management.ObjectName;
+import javax.naming.Context;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -140,6 +141,11 @@
{
return ejbMetaData.determineContainerName();
}
+
+ public Context getContext()
+ {
+ return ejbContainer.getEnc();
+ }
public String getComponentName()
{
Modified: branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java
===================================================================
--- branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java 2009-04-28 07:08:45 UTC (rev 87926)
+++ branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java 2009-04-28 07:23:51 UTC (rev 87927)
@@ -28,17 +28,24 @@
import java.util.Set;
import javax.jws.WebService;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
import javax.xml.ws.WebServiceProvider;
import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeansMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData;
import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
import org.jboss.metadata.javaee.spec.ResourceInjectionTargetMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
import org.jboss.wsf.spi.metadata.injection.InjectionMetaData;
import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
@@ -50,6 +57,9 @@
public final class InjectionMetaDataDeploymentAspect extends DeploymentAspect
{
+ private static final String EJB3_JNDI_PREFIX = "java:env/";
+ private static final String POJO_JNDI_PREFIX = "java:comp/env/";
+
@Override
public void create(Deployment dep)
{
@@ -59,23 +69,36 @@
if (webMD == null)
throw new IllegalStateException("JBossWebMetaData not found");
+ DeploymentUnit unit = dep.getAttachment(DeploymentUnit.class);
+ if (unit == null)
+ throw new IllegalStateException("DeploymentUnit not found");
+
List<InjectionMetaData> injectionMD = new LinkedList<InjectionMetaData>();
DeploymentType deploymentType = dep.getType();
if (deploymentType == DeploymentType.JAXWS_JSE)
{
injectionMD.addAll(buildInjectionMetaData(webMD.getEnvironmentEntries()));
+ try
+ {
+ final Context ctx = new InitialContext();
+ for (Endpoint endpoint : dep.getService().getEndpoints())
+ {
+ InjectionsMetaData injectionsMD = new InjectionsMetaData(injectionMD, ctx, POJO_JNDI_PREFIX);
+ endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
+ }
+ }
+ catch (NamingException ne)
+ {
+ throw new RuntimeException(ne);
+ }
}
else if (deploymentType == DeploymentType.JAXWS_EJB3)
{
- // [JBWS-2074] see comment in JIRA
- log.warn("Both @Resource annotated methods/fields and descriptor specified injections don't work in handlers associated with EJB3 endpoints");
- /*
JBossMetaData jbossMD = unit.getAttachment(JBossMetaData.class);
JBossEnterpriseBeansMetaData jebMDs = jbossMD.getEnterpriseBeans();
WebServiceDeployment webServiceDeployment = unit.getAttachment(WebServiceDeployment.class);
- EnvironmentEntriesMetaData attachment = new EnvironmentEntriesMetaData();
Iterator<WebServiceDeclaration> it = webServiceDeployment.getServiceEndpoints().iterator();
while (it.hasNext())
@@ -83,16 +106,16 @@
WebServiceDeclaration container = it.next();
if (isWebServiceBean(container))
{
+ Context ctx = container.getContext();
String ejbName = container.getComponentName();
EnvironmentEntriesMetaData ejbEnvEntries = jebMDs.get(ejbName).getEnvironmentEntries();
- attachment.addAll(ejbEnvEntries);
injectionMD.addAll(buildInjectionMetaData(ejbEnvEntries));
+ Endpoint endpoint = dep.getService().getEndpointByName(ejbName);
+ InjectionsMetaData injectionsMD = new InjectionsMetaData(injectionMD, ctx, EJB3_JNDI_PREFIX);
+ endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
}
}
- */
}
-
- dep.getService().addAttachment(InjectionsMetaData.class, new InjectionsMetaData(injectionMD));
}
@Override
@@ -134,9 +157,7 @@
targetClass = ritMD.getInjectionTargetClass();
targetName = ritMD.getInjectionTargetName();
InjectionMetaData injectionMD = new InjectionMetaData(targetClass, targetName, valueClass, envEntryName, envEntryValue != null);
-
retVal.add(injectionMD);
- log.debug(injectionMD);
}
}
}
Modified: branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java
===================================================================
--- branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java 2009-04-28 07:08:45 UTC (rev 87926)
+++ branches/Branch_5_x/webservices/src/main/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java 2009-04-28 07:23:51 UTC (rev 87927)
@@ -82,7 +82,7 @@
throw new IllegalStateException("Cannot get target bean instance", ex);
}
- JavaxAnnotationHelper.injectResources(targetBean, ep.getService().getAttachment(InjectionsMetaData.class));
+ JavaxAnnotationHelper.injectResources(targetBean, ep.getAttachment(InjectionsMetaData.class));
JavaxAnnotationHelper.callPostConstructMethod(targetBean);
ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
}
Modified: branches/Branch_5_x/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml
===================================================================
--- branches/Branch_5_x/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml 2009-04-28 07:08:45 UTC (rev 87926)
+++ branches/Branch_5_x/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml 2009-04-28 07:23:51 UTC (rev 87927)
@@ -346,7 +346,6 @@
<property name="aspects">
<set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect">
<inject bean="WSDynamicEndpointDeploymentAspect"/>
- <inject bean="WSInjectionMetaDataDeploymentAspect"/>
<inject bean="WSEndpointAPIDeploymentAspect"/>
<inject bean="WSVirtualHostDeploymentAspect"/>
<inject bean="WSEndpointAddressDeploymentAspect"/>
More information about the jboss-cvs-commits
mailing list