Author: thomas.diesler(a)jboss.com
Date: 2007-01-29 04:16:37 -0500 (Mon, 29 Jan 2007)
New Revision: 2172
Modified:
branches/jbossws-1.2.0/build/ant-import/build-thirdparty.xml
branches/jbossws-1.2.0/build/etc/jbossws-component-info.xml
branches/jbossws-1.2.0/build/version.properties
branches/jbossws-1.2.0/integration-jboss42/build.xml
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
branches/jbossws-1.2.0/integration-jboss50/build.xml
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
branches/jbossws-1.2.0/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java
Log:
jboss50 EJB21 support, first cut
Modified: branches/jbossws-1.2.0/build/ant-import/build-thirdparty.xml
===================================================================
--- branches/jbossws-1.2.0/build/ant-import/build-thirdparty.xml 2007-01-28 09:11:18 UTC
(rev 2171)
+++ branches/jbossws-1.2.0/build/ant-import/build-thirdparty.xml 2007-01-29 09:16:37 UTC
(rev 2172)
@@ -50,10 +50,9 @@
<get
src="${jboss.repository}/jboss/jbossretro/${jboss-jbossretro}/lib/jbossretro.jar"
dest="${thirdparty.dir}/jbossretro.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/jbossretro/${jboss-jbossretro}/lib/jbossretro-rt.jar"
dest="${thirdparty.dir}/jbossretro-rt.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding.jar"
dest="${thirdparty.dir}/jboss-xml-binding.jar" usetimestamp="true"
verbose="true"/>
- <get
src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding-src.zip"
dest="${thirdparty.dir}/jboss-xml-binding-src.zip" usetimestamp="true"
verbose="true"/>
+ <!--get
src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding-src.zip"
dest="${thirdparty.dir}/jboss-xml-binding-src.zip" usetimestamp="true"
verbose="true"/-->
<get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-container.jar"
dest="${thirdparty.dir}/jboss-container.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-dependency.jar"
dest="${thirdparty.dir}/jboss-dependency.jar" usetimestamp="true"
verbose="true"/>
- <get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-deployers.jar"
dest="${thirdparty.dir}/jboss-deployers.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-microcontainer.jar"
dest="${thirdparty.dir}/jboss-microcontainer.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/remoting/${jboss-remoting}/lib/jboss-remoting.jar"
dest="${thirdparty.dir}/jboss-remoting.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/security/${jboss-security}/lib/jbosssx-client.jar"
dest="${thirdparty.dir}/jbosssx-client.jar" usetimestamp="true"
verbose="true"/>
Modified: branches/jbossws-1.2.0/build/etc/jbossws-component-info.xml
===================================================================
--- branches/jbossws-1.2.0/build/etc/jbossws-component-info.xml 2007-01-28 09:11:18 UTC
(rev 2171)
+++ branches/jbossws-1.2.0/build/etc/jbossws-component-info.xml 2007-01-29 09:16:37 UTC
(rev 2172)
@@ -25,14 +25,12 @@
</import>
<import componentref="jboss/jbossxb">
<compatible version="@jboss-jbossxb@"/>
- <compatible version="snapshot"/>
</import>
<import componentref="jboss/microcontainer">
- <compatible version="1.0.2"/>
+ <compatible version="snapshot"/>
<compatible version="@jboss-microcontainer@"/>
</import>
<import componentref="jboss/remoting">
- <compatible version="1.4.5.GA"/>
<compatible version="2.2.0.Alpha2"/>
<compatible version="@jboss-remoting@"/>
</import>
@@ -41,6 +39,7 @@
</import>
<export>
+ <include input="jbossws-client.jar"/>
<include input="jboss-jaxrpc.jar"/>
<include input="jboss-jaxws.jar"/>
<include input="jboss-saaj.jar"/>
Modified: branches/jbossws-1.2.0/build/version.properties
===================================================================
--- branches/jbossws-1.2.0/build/version.properties 2007-01-28 09:11:18 UTC (rev 2171)
+++ branches/jbossws-1.2.0/build/version.properties 2007-01-29 09:16:37 UTC (rev 2172)
@@ -17,8 +17,8 @@
apache-xmlsec=1.3.0
ibm-wsdl4j=1.5.2jboss
javassist=3.4.GA
-jboss-jbossxb=1.0.0.CR7
-jboss-microcontainer=snapshot
+jboss-jbossxb=snapshot
+jboss-microcontainer=1.0.2
jboss-remoting=2.0.0.GA
sun-jaxb=2.0.3
Modified: branches/jbossws-1.2.0/integration-jboss42/build.xml
===================================================================
--- branches/jbossws-1.2.0/integration-jboss42/build.xml 2007-01-28 09:11:18 UTC (rev
2171)
+++ branches/jbossws-1.2.0/integration-jboss42/build.xml 2007-01-29 09:16:37 UTC (rev
2172)
@@ -164,10 +164,6 @@
<include name="jboss-saaj.jar"/>
</fileset>
</copy>
- <!-- Copy jboss-xml-binding.jar -->
- <copy todir="${jboss42.home}//../../../thirdparty/jboss/jbossxb/lib"
file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
- <copy todir="${jboss42.home}/client"
file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
- <copy todir="${jboss42.home}/lib"
file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
</target>
<!-- ================================================================== -->
Modified:
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java 2007-01-28
09:11:18 UTC (rev 2171)
+++
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java 2007-01-29
09:16:37 UTC (rev 2172)
@@ -31,9 +31,10 @@
import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.BeanMetaData;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.JAXWSDeployment;
+import org.jboss.ws.core.UnifiedVirtualFile;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
/**
@@ -46,8 +47,8 @@
{
protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
{
- URL webservicesURL = getWebservicesDescriptor(di);
- UnifiedDeploymentInfo udi = new
JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_EJB21, webservicesURL);
+ UnifiedVirtualFile vfsWebservices = getWebservicesFile(di);
+ UnifiedDeploymentInfo udi = new
JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_EJB21, vfsWebservices);
DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
return udi;
}
@@ -62,7 +63,7 @@
// Check if we have a webservices.xml descriptor
if (isWebserviceDeployment == false)
{
- isWebserviceDeployment = getWebservicesDescriptor(di) != null;
+ isWebserviceDeployment = getWebservicesFile(di) != null;
}
// Check if the ejb-jar contains annotated endpoints
@@ -94,12 +95,10 @@
return isWebserviceDeployment;
}
- /**
- * Get the resource name of the webservices.xml descriptor.
- */
- protected URL getWebservicesDescriptor(DeploymentInfo di)
+ protected UnifiedVirtualFile getWebservicesFile(DeploymentInfo di)
{
- return di.localCl.findResource("META-INF/webservices.xml");
+ URL url = di.localCl.findResource("META-INF/webservices.xml");
+ return url != null ? new ResourceLoaderAdapter(di.localCl) : null;
}
protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData)
throws IOException
Modified:
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2007-01-28
09:11:18 UTC (rev 2171)
+++
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2007-01-29
09:16:37 UTC (rev 2172)
@@ -33,6 +33,7 @@
import org.jboss.deployment.DeploymentInfo;
import org.jboss.metadata.WebMetaData;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.UnifiedVirtualFile;
import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
import org.jboss.ws.core.server.JAXWSDeployment;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
@@ -40,6 +41,7 @@
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
@@ -62,7 +64,7 @@
// Check if we have a webservices.xml descriptor
if (isWebserviceDeployment == false)
{
- if (getWebservicesDescriptor(di) != null)
+ if (getWebservicesFile(di) != null)
{
di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE);
isWebserviceDeployment = true;
@@ -104,8 +106,8 @@
DeploymentType type =
(DeploymentType)di.context.get("UnifiedDeploymentInfo.Type");
if (type == UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE)
{
- URL webservicesURL = getWebservicesDescriptor(di);
- udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE,
webservicesURL);
+ UnifiedVirtualFile vfsWebservices = getWebservicesFile(di);
+ udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE,
vfsWebservices);
DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
}
else if (type == UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE)
@@ -153,11 +155,9 @@
}
}
- /**
- * Get the resource name of the webservices.xml descriptor.
- */
- protected URL getWebservicesDescriptor(DeploymentInfo di)
+ protected UnifiedVirtualFile getWebservicesFile(DeploymentInfo di)
{
- return di.localCl.findResource("WEB-INF/webservices.xml");
+ URL url = di.localCl.findResource("WEB-INF/webservices.xml");
+ return url != null ? new ResourceLoaderAdapter(di.localCl) : null;
}
}
Modified: branches/jbossws-1.2.0/integration-jboss50/build.xml
===================================================================
--- branches/jbossws-1.2.0/integration-jboss50/build.xml 2007-01-28 09:11:18 UTC (rev
2171)
+++ branches/jbossws-1.2.0/integration-jboss50/build.xml 2007-01-29 09:16:37 UTC (rev
2172)
@@ -173,10 +173,6 @@
<include name="jboss-saaj.jar"/>
</fileset>
</copy>
- <!-- Copy jboss-xml-binding.jar -->
- <copy todir="${jboss50.home}//../../../thirdparty/jboss/jbossxb/lib"
file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
- <copy todir="${jboss50.home}/client"
file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
- <copy todir="${jboss50.home}/lib"
file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
</target>
<!-- ================================================================== -->
Modified:
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2007-01-28
09:11:18 UTC (rev 2171)
+++
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2007-01-29
09:16:37 UTC (rev 2172)
@@ -34,10 +34,17 @@
import org.jboss.ejb3.SessionContainer;
import org.jboss.ejb3.mdb.MessagingContainer;
import org.jboss.logging.Logger;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.BeanMetaData;
+import org.jboss.metadata.EjbPortComponentMetaData;
+import org.jboss.metadata.MessageDrivenMetaData;
+import org.jboss.metadata.SessionMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedSessionMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData.PublishLocationAdapter;
/**
* Build container independent application meta data
@@ -49,23 +56,11 @@
{
// logging support
private static Logger log = Logger.getLogger(ApplicationMetaDataAdaptor.class);
-
- public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(DeploymentUnit unit)
+
+ public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(DeploymentUnit unit, Ejb3Deployment ejb3Deployment)
{
UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
- buildUnifiedBeanMetaData(umd, unit);
- //umd.setConfigName(apmd.getConfigName());
- //umd.setConfigFile(apmd.getConfigFile());
- //umd.setWebServiceContextRoot(apmd.getWebServiceContextRoot());
- //umd.setSecurityDomain(apmd.getSecurityDomain());
- //umd.setWsdlPublishLocationMap(apmd.getWsdlPublishLocationMap());
- return umd;
- }
-
- private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
DeploymentUnit unit)
- {
List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
- Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class);
Iterator<Container> it =
ejb3Deployment.getEjbContainers().values().iterator();
while (it.hasNext())
{
@@ -77,6 +72,7 @@
}
}
umd.setEnterpriseBeans(beans);
+ return umd;
}
private static UnifiedBeanMetaData buildUnifiedBeanMetaData(EJBContainer container)
@@ -89,7 +85,7 @@
else if (container instanceof MessagingContainer)
{
ubmd = new UnifiedMessageDrivenMetaData();
- log.warn ("No implemented: initialize MDB destination");
+ log.warn("No implemented: initialize MDB destination");
//((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessagingContainer)container).getDestination());
}
@@ -97,23 +93,82 @@
{
ubmd.setEjbName(container.getEjbName());
ubmd.setEjbClass(container.getBeanClassName());
-// ubmd.setServiceEndpoint(container.getServiceEndpoint());
-// ubmd.setHome(container.getHome());
-// ubmd.setLocalHome(container.getLocalHome());
-// ubmd.setJndiName(container.getJndiName());
-// ubmd.setLocalJndiName(container.getLocalJndiName());
+ }
+ return ubmd;
+ }
-// EjbPortComponentMetaData pcmd = container.getPortComponent();
-// if (pcmd != null)
-// {
-// UnifiedEjbPortComponentMetaData upcmd = new
UnifiedEjbPortComponentMetaData();
-// upcmd.setPortComponentName(pcmd.getPortComponentName());
-// upcmd.setPortComponentURI(pcmd.getPortComponentURI());
-// upcmd.setAuthMethod(pcmd.getAuthMethod());
-// upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
-// ubmd.setPortComponent(upcmd);
-// }
+ public static UnifiedApplicationMetaData
buildUnifiedApplicationMetaData(DeploymentUnit unit, ApplicationMetaData apmd)
+ {
+ UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
+ buildUnifiedBeanMetaData(umd, apmd);
+ umd.setConfigName(apmd.getConfigName());
+ umd.setConfigFile(apmd.getConfigFile());
+ umd.setWebServiceContextRoot(apmd.getWebServiceContextRoot());
+ umd.setSecurityDomain(apmd.getSecurityDomain());
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(apmd));
+ return umd;
+ }
+
+ private static PublishLocationAdapter getPublishLocationAdpater(final
ApplicationMetaData apmd)
+ {
+ return new PublishLocationAdapter() {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ return apmd.getWsdlPublishLocationByName(name);
+ }
+ };
+ }
+
+ private static void buildUnifiedBeanMetaData(UnifiedApplicationMetaData umd,
ApplicationMetaData metaData)
+ {
+ List<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
+ Iterator it = metaData.getEnterpriseBeans();
+ while (it.hasNext())
+ {
+ BeanMetaData bmd = (BeanMetaData)it.next();
+ UnifiedBeanMetaData ubmd = buildUnifiedBeanMetaData(bmd);
+ if (ubmd != null)
+ {
+ beans.add(ubmd);
+ }
}
+ umd.setEnterpriseBeans(beans);
+ }
+
+ private static UnifiedBeanMetaData buildUnifiedBeanMetaData(BeanMetaData bmd)
+ {
+ UnifiedBeanMetaData ubmd = null;
+ if (bmd instanceof SessionMetaData)
+ {
+ ubmd = new UnifiedSessionMetaData();
+ }
+ else if (bmd instanceof MessageDrivenMetaData)
+ {
+ ubmd = new UnifiedMessageDrivenMetaData();
+
((UnifiedMessageDrivenMetaData)ubmd).setDestinationJndiName(((MessageDrivenMetaData)bmd).getDestinationJndiName());
+ }
+
+ if (ubmd != null)
+ {
+ ubmd.setEjbName(bmd.getEjbName());
+ ubmd.setEjbClass(bmd.getEjbClass());
+ ubmd.setServiceEndpoint(bmd.getServiceEndpoint());
+ ubmd.setHome(bmd.getHome());
+ ubmd.setLocalHome(bmd.getLocalHome());
+ ubmd.setJndiName(bmd.getJndiName());
+ ubmd.setLocalJndiName(bmd.getLocalJndiName());
+
+ EjbPortComponentMetaData pcmd = bmd.getPortComponent();
+ if (pcmd != null)
+ {
+ UnifiedEjbPortComponentMetaData upcmd = new
UnifiedEjbPortComponentMetaData();
+ upcmd.setPortComponentName(pcmd.getPortComponentName());
+ upcmd.setPortComponentURI(pcmd.getPortComponentURI());
+ upcmd.setAuthMethod(pcmd.getAuthMethod());
+ upcmd.setTransportGuarantee(pcmd.getTransportGuarantee());
+ ubmd.setPortComponent(upcmd);
+ }
+ }
return ubmd;
}
}
Modified:
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java 2007-01-28
09:11:18 UTC (rev 2171)
+++
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java 2007-01-29
09:16:37 UTC (rev 2172)
@@ -28,6 +28,7 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.ejb3.Ejb3Deployment;
import org.jboss.logging.Logger;
+import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.WebMetaData;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
@@ -80,8 +81,14 @@
{
if (unit.getAttachment(Ejb3Deployment.class) != null)
{
- udi.metaData =
ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData(unit);
+ Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class);
+ udi.metaData = ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData(unit,
ejb3Deployment);
}
+ else if (unit.getAttachment(ApplicationMetaData.class) != null)
+ {
+ ApplicationMetaData appMetaData =
unit.getAttachment(ApplicationMetaData.class);
+ udi.metaData = ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData(unit,
appMetaData);
+ }
else
{
if (unit.getAllMetaData(WebMetaData.class).size() > 0)
Modified:
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java 2007-01-28
09:11:18 UTC (rev 2171)
+++
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java 2007-01-29
09:16:37 UTC (rev 2172)
@@ -25,7 +25,8 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.virtual.VirtualFile;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
@@ -47,7 +48,8 @@
@Override
protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
throws DeploymentException
{
- UnifiedDeploymentInfo udi = new JAXRPCDeployment(getDeploymentType(), null);
+ VirtualFileAdaptor vfWebservices = new
VirtualFileAdaptor(getWebServicesFile(unit));
+ UnifiedDeploymentInfo udi = new JAXRPCDeployment(getDeploymentType(),
vfWebservices);
DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
return udi;
}
@@ -55,14 +57,13 @@
@Override
public boolean isWebServiceDeployment(DeploymentUnit unit)
{
- boolean isWebServiceDeployment = false;
+ boolean hasAppMetaData = unit.getAllMetaData(ApplicationMetaData.class).size() >
0;
+ return hasAppMetaData && getWebServicesFile(unit) != null;
+ }
- Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class);
- if (ejb3Deployment != null)
- {
- isWebServiceDeployment =
unit.getMetaDataFile("META-INF/webservices.xml") != null;
- }
-
- return isWebServiceDeployment;
+ private VirtualFile getWebServicesFile(DeploymentUnit unit)
+ {
+ VirtualFile vfile = unit.getMetaDataFile("webservices.xml");
+ return vfile;
}
}
\ No newline at end of file
Modified:
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2007-01-28
09:11:18 UTC (rev 2171)
+++
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2007-01-29
09:16:37 UTC (rev 2172)
@@ -23,14 +23,12 @@
//$Id$
-import java.net.URL;
-import java.util.Set;
-
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.metadata.WebMetaData;
import org.jboss.virtual.VirtualFile;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.UnifiedVirtualFile;
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
@@ -49,36 +47,24 @@
}
@Override
- public boolean isWebServiceDeployment(DeploymentUnit unit)
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
throws DeploymentException
{
- boolean hasWebMetaData = unit.getAllMetaData(WebMetaData.class).size() > 0;
- return hasWebMetaData && getWebServicesURL(unit) != null;
+ UnifiedVirtualFile vfWebservices = getWebServicesFile(unit);
+ UnifiedDeploymentInfo udi = new JAXRPCDeployment(getDeploymentType(),
vfWebservices);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
+ return udi;
}
@Override
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
throws DeploymentException
+ public boolean isWebServiceDeployment(DeploymentUnit unit)
{
- URL webservicesUrl = getWebServicesURL(unit);
- UnifiedDeploymentInfo udi = new JAXRPCDeployment(getDeploymentType(),
webservicesUrl);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
- return udi;
+ boolean hasWebMetaData = unit.getAllMetaData(WebMetaData.class).size() > 0;
+ return hasWebMetaData && getWebServicesFile(unit) != null;
}
- private URL getWebServicesURL(DeploymentUnit unit)
+ private UnifiedVirtualFile getWebServicesFile(DeploymentUnit unit)
{
- URL webservicesURL = null;
VirtualFile vfile = unit.getMetaDataFile("webservices.xml");
- if (vfile != null)
- {
- try
- {
- webservicesURL = vfile.toURL();
- }
- catch (Exception ex)
- {
- // ignore
- }
- }
- return webservicesURL;
+ return vfile != null ? new VirtualFileAdaptor(vfile) : null;
}
}
Modified:
branches/jbossws-1.2.0/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
===================================================================
---
branches/jbossws-1.2.0/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2007-01-28
09:11:18 UTC (rev 2171)
+++
branches/jbossws-1.2.0/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2007-01-29
09:16:37 UTC (rev 2172)
@@ -38,12 +38,14 @@
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.UnifiedVirtualFile;
import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
import org.jboss.ws.core.server.JAXWSDeployment;
import org.jboss.ws.core.server.KernelLocator;
import org.jboss.ws.core.server.ServiceEndpointDeployer;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
/**
* A servlet that is installed for every web service endpoint.
@@ -161,10 +163,10 @@
UnifiedDeploymentInfo udi;
URLClassLoader ctxLoader =
(URLClassLoader)Thread.currentThread().getContextClassLoader();
- URL webservicesURL = ctxLoader.findResource("WEB-INF/webservices.xml");
- if (webservicesURL != null)
+ UnifiedVirtualFile vfsWebservices = getWebservicesFile(ctxLoader);
+ if (vfsWebservices != null)
{
- udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE,
webservicesURL);
+ udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE,
vfsWebservices);
}
else
{
@@ -175,6 +177,12 @@
return udi;
}
+ protected UnifiedVirtualFile getWebservicesFile(URLClassLoader ctxLoader)
+ {
+ URL url = ctxLoader.findResource("WEB-INF/webservices.xml");
+ return url != null ? new ResourceLoaderAdapter(ctxLoader) : null;
+ }
+
private void undeployServiceEndpoints(ServletContext servletContext)
{
UnifiedDeploymentInfo udi =
(UnifiedDeploymentInfo)servletContext.getAttribute(UnifiedDeploymentInfo.class.getName());
Modified:
branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java 2007-01-28
09:11:18 UTC (rev 2171)
+++
branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCDeployment.java 2007-01-29
09:16:37 UTC (rev 2172)
@@ -24,6 +24,7 @@
import java.io.InputStream;
import java.net.URL;
+import org.jboss.ws.core.UnifiedVirtualFile;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.metadata.webservices.WebservicesFactory;
import org.jboss.ws.metadata.webservices.WebservicesMetaData;
@@ -43,13 +44,14 @@
{
private WebservicesMetaData jsr109MetaData;
- public JAXRPCDeployment(DeploymentType type, URL webservicesURL)
+ public JAXRPCDeployment(DeploymentType type, UnifiedVirtualFile vfWebservices)
{
super(type);
try
{
// Unmarshall webservices.xml
+ URL webservicesURL = vfWebservices.toURL();
InputStream is = webservicesURL.openStream();
try
{