JBossWS SVN: r1681 - in branches/tdiesler/jbossws-1.0: . src/ant
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-21 05:11:41 -0500 (Thu, 21 Dec 2006)
New Revision: 1681
Modified:
branches/tdiesler/jbossws-1.0/.classpath
branches/tdiesler/jbossws-1.0/src/ant/build-thirdparty.xml
branches/tdiesler/jbossws-1.0/version.properties
Log:
update dependencies to jboss-4.2.x
Modified: branches/tdiesler/jbossws-1.0/.classpath
===================================================================
--- branches/tdiesler/jbossws-1.0/.classpath 2006-12-21 10:08:10 UTC (rev 1680)
+++ branches/tdiesler/jbossws-1.0/.classpath 2006-12-21 10:11:41 UTC (rev 1681)
@@ -24,11 +24,6 @@
<classpathentry kind="lib" path="thirdparty/stax-api-1.0.jar"/>
<classpathentry kind="lib" path="thirdparty/wstx-lgpl-2.0.6.jar"/>
<classpathentry kind="lib" path="thirdparty/ant.jar"/>
- <classpathentry kind="lib" path="thirdparty/jboss.jar" sourcepath="/home/tdiesler/svn/jbossas/tags/JBoss_4_0_5_GA/server/src/main"/>
- <classpathentry kind="lib" path="thirdparty/jboss-j2ee.jar"/>
- <classpathentry kind="lib" path="thirdparty/jboss-jmx.jar"/>
- <classpathentry kind="lib" path="thirdparty/jbosssx.jar"/>
- <classpathentry kind="lib" path="thirdparty/jboss-system.jar"/>
<classpathentry kind="lib" path="thirdparty/jboss-common.jar"/>
<classpathentry kind="lib" path="thirdparty/jboss-remoting.jar"/>
<classpathentry kind="lib" path="thirdparty/wsdl4j.jar"/>
Modified: branches/tdiesler/jbossws-1.0/src/ant/build-thirdparty.xml
===================================================================
--- branches/tdiesler/jbossws-1.0/src/ant/build-thirdparty.xml 2006-12-21 10:08:10 UTC (rev 1680)
+++ branches/tdiesler/jbossws-1.0/src/ant/build-thirdparty.xml 2006-12-21 10:11:41 UTC (rev 1681)
@@ -36,11 +36,6 @@
<get src="${jboss.repository}/apache-xmlsec/${apache-xmlsec}/lib/xmlsec.jar" dest="${thirdparty.dir}/xmlsec.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/ibm-wsdl4j/${ibm-wsdl4j}/lib/wsdl4j.jar" dest="${thirdparty.dir}/wsdl4j.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/javassist/${javassist}/lib/javassist.jar" dest="${thirdparty.dir}/javassist.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/jbossas/core-libs/${jbossas}/lib/jboss.jar" dest="${thirdparty.dir}/jboss.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/jbossas/core-libs/${jbossas}/lib/jbosssx.jar" dest="${thirdparty.dir}/jbosssx.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/jbossas/core-libs/${jbossas}/lib/jboss-j2ee.jar" dest="${thirdparty.dir}/jboss-j2ee.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/jbossas/core-libs/${jbossas}/lib/jboss-jmx.jar" dest="${thirdparty.dir}/jboss-jmx.jar" usetimestamp="true" verbose="true"/>
- <get src="${jboss.repository}/jbossas/core-libs/${jbossas}/lib/jboss-system.jar" dest="${thirdparty.dir}/jboss-system.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/backport-concurrent/${jboss-backport-concurrent}/lib/jboss-backport-concurrent.jar" dest="${thirdparty.dir}/jboss-backport-concurrent.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/common/${jboss-common}/lib/jboss-common.jar" dest="${thirdparty.dir}/jboss-common.jar" 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"/>
@@ -74,7 +69,6 @@
<pathelement location="${thirdparty.dir}/jboss-common.jar"/>
<pathelement location="${thirdparty.dir}/jboss-container.jar"/>
<pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-j2ee.jar"/>
<pathelement location="${thirdparty.dir}/jboss-microcontainer.jar"/>
<pathelement location="${thirdparty.dir}/jboss-remoting.jar"/>
<pathelement location="${thirdparty.dir}/jboss-xml-binding.jar"/>
@@ -95,20 +89,21 @@
<!-- The classpath for the jbossws core -->
<path id="jboss.core.classpath">
+ <pathelement location="${jboss.server.lib}/jboss-j2ee.jar"/>
<pathelement location="${jboss.server.deploy}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
</path>
<!-- The classpath for the jboss integration -->
<path id="jboss.integration.classpath">
- <pathelement location="${thirdparty.dir}/jboss.jar"/>
- <pathelement location="${thirdparty.dir}/jbosssx.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-jmx.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-system.jar"/>
- <pathelement location="${jboss.server.deploy}/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
- <pathelement location="${jboss.server.deploy}/jboss-aop-jdk50.deployer/jboss-aspect-library-jdk50.jar"/>
+ <pathelement location="${jboss.lib}/jboss-jmx.jar"/>
+ <pathelement location="${jboss.lib}/jboss-system.jar"/>
+ <pathelement location="${jboss.server.lib}/jboss.jar"/>
+ <pathelement location="${jboss.server.lib}/jbosssx.jar"/>
<pathelement location="${jboss.server.deploy}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
<pathelement location="${jboss.server.deploy}/ejb3.deployer/jboss-ejb3.jar"/>
<pathelement location="${jboss.server.deploy}/ejb3.deployer/jboss-ejb3x.jar"/>
+ <pathelement location="${jboss.server.deploy}/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+ <pathelement location="${jboss.server.deploy}/jboss-aop-jdk50.deployer/jboss-aspect-library-jdk50.jar"/>
</path>
</target>
Modified: branches/tdiesler/jbossws-1.0/version.properties
===================================================================
--- branches/tdiesler/jbossws-1.0/version.properties 2006-12-21 10:08:10 UTC (rev 1680)
+++ branches/tdiesler/jbossws-1.0/version.properties 2006-12-21 10:11:41 UTC (rev 1681)
@@ -31,7 +31,6 @@
apache-xerces=2.7.1
jboss-backport-concurrent=2.1.0.GA
jboss-jbossretro=1.0.2.GA
-jbossas=4.0.4.GA
jbpm-bpel=1.1.Beta2
junit=3.8.1
oswego-concurrent=1.3.4
19 years
JBossWS SVN: r1680 - branches/tdiesler
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-21 05:08:10 -0500 (Thu, 21 Dec 2006)
New Revision: 1680
Added:
branches/tdiesler/jbossws-1.0/
Log:
recreate userbrance
Copied: branches/tdiesler/jbossws-1.0 (from rev 1679, branches/jbossws-1.0)
19 years
JBossWS SVN: r1679 - branches/tdiesler
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-21 05:07:41 -0500 (Thu, 21 Dec 2006)
New Revision: 1679
Removed:
branches/tdiesler/jbossws-1.0/
Log:
recreate userbrance
19 years
JBossWS SVN: r1678 - branches/tdiesler/trunk
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-21 04:59:32 -0500 (Thu, 21 Dec 2006)
New Revision: 1678
Modified:
branches/tdiesler/trunk/STATUS_AND_NEWS.txt
Log:
svn test
Modified: branches/tdiesler/trunk/STATUS_AND_NEWS.txt
===================================================================
--- branches/tdiesler/trunk/STATUS_AND_NEWS.txt 2006-12-21 09:57:35 UTC (rev 1677)
+++ branches/tdiesler/trunk/STATUS_AND_NEWS.txt 2006-12-21 09:59:32 UTC (rev 1678)
@@ -1,5 +1,6 @@
# $Id$
+a
18-Dec-2006
-----------
* All good with jbossas -r 59084
19 years
JBossWS SVN: r1677 - branches/tdiesler/trunk
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-21 04:57:35 -0500 (Thu, 21 Dec 2006)
New Revision: 1677
Modified:
branches/tdiesler/trunk/STATUS_AND_NEWS.txt
Log:
svn test
Modified: branches/tdiesler/trunk/STATUS_AND_NEWS.txt
===================================================================
--- branches/tdiesler/trunk/STATUS_AND_NEWS.txt 2006-12-21 09:56:09 UTC (rev 1676)
+++ branches/tdiesler/trunk/STATUS_AND_NEWS.txt 2006-12-21 09:57:35 UTC (rev 1677)
@@ -2,7 +2,7 @@
18-Dec-2006
-----------
-* All good with jbossas -r 59084
+* All good with jbossas -r 59084
11-Dec-2006
-----------
19 years
JBossWS SVN: r1676 - in branches/tdiesler/trunk: . src/ant
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-21 04:56:09 -0500 (Thu, 21 Dec 2006)
New Revision: 1676
Modified:
branches/tdiesler/trunk/STATUS_AND_NEWS.txt
branches/tdiesler/trunk/src/ant/build-thirdparty.xml
Log:
no-auth-cache
Modified: branches/tdiesler/trunk/STATUS_AND_NEWS.txt
===================================================================
--- branches/tdiesler/trunk/STATUS_AND_NEWS.txt 2006-12-21 09:45:07 UTC (rev 1675)
+++ branches/tdiesler/trunk/STATUS_AND_NEWS.txt 2006-12-21 09:56:09 UTC (rev 1676)
@@ -2,7 +2,7 @@
18-Dec-2006
-----------
-* All good with jbossas -r 59084
+* All good with jbossas -r 59084
11-Dec-2006
-----------
Modified: branches/tdiesler/trunk/src/ant/build-thirdparty.xml
===================================================================
--- branches/tdiesler/trunk/src/ant/build-thirdparty.xml 2006-12-21 09:45:07 UTC (rev 1675)
+++ branches/tdiesler/trunk/src/ant/build-thirdparty.xml 2006-12-21 09:56:09 UTC (rev 1676)
@@ -119,8 +119,8 @@
<pathelement location="${jboss42.lib}/jboss-jmx.jar"/>
<pathelement location="${jboss42.lib}/jboss-system.jar"/>
<pathelement location="${jboss42.server.lib}/jboss.jar"/>
+ <pathelement location="${jboss42.server.lib}/jboss-j2ee.jar"/>
<pathelement location="${jboss42.server.lib}/jbosssx.jar"/>
- <pathelement location="${jboss42.server.lib}/jboss-j2ee.jar"/>
<pathelement location="${jboss42.server.deploy}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
<pathelement location="${jboss42.server.deploy}/ejb3.deployer/jboss-ejb3.jar"/>
<pathelement location="${jboss42.server.deploy}/ejb3.deployer/jboss-ejb3x.jar"/>
19 years
JBossWS SVN: r1675 - branches/tdiesler/trunk
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-21 04:45:07 -0500 (Thu, 21 Dec 2006)
New Revision: 1675
Modified:
branches/tdiesler/trunk/STATUS_AND_NEWS.txt
Log:
svn test
Modified: branches/tdiesler/trunk/STATUS_AND_NEWS.txt
===================================================================
--- branches/tdiesler/trunk/STATUS_AND_NEWS.txt 2006-12-20 19:36:24 UTC (rev 1674)
+++ branches/tdiesler/trunk/STATUS_AND_NEWS.txt 2006-12-21 09:45:07 UTC (rev 1675)
@@ -2,7 +2,7 @@
18-Dec-2006
-----------
-* All good with jbossas -r 59084
+* All good with jbossas -r 59084
11-Dec-2006
-----------
19 years
JBossWS SVN: r1674 - in branches/tdiesler/trunk: . src/ant src/main/java/org/jboss/ws/core/server src/main/java/org/jboss/ws/integration src/main/java/org/jboss/ws/integration/jboss42 src/main/java/org/jboss/ws/integration/jboss42/jms
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-20 14:36:24 -0500 (Wed, 20 Dec 2006)
New Revision: 1674
Added:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointPublisher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB21.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInterceptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointPublisher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcherMBean.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSTransportSupport.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/MessageDispatcher.java
Modified:
branches/tdiesler/trunk/.classpath
branches/tdiesler/trunk/ant.properties.example
branches/tdiesler/trunk/build.xml
branches/tdiesler/trunk/src/ant/build-thirdparty.xml
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
Log:
partial commit
Modified: branches/tdiesler/trunk/.classpath
===================================================================
--- branches/tdiesler/trunk/.classpath 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/.classpath 2006-12-20 19:36:24 UTC (rev 1674)
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry excluding="org/jboss/ws/integration/jboss50/ServiceRefHandler.java" kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="output/tests/wstools/java"/>
- <classpathentry excluding="org/jboss/test/ws/interop/" kind="src" path="src/test/java"/>
+ <classpathentry excluding="org/jboss/ws/integration/jboss50/**" kind="src" path="src/main/java"/>
<classpathentry kind="lib" path="thirdparty/activation.jar"/>
<classpathentry kind="lib" path="thirdparty/mailapi.jar"/>
<classpathentry kind="lib" path="thirdparty/qdox.jar"/>
@@ -32,6 +30,6 @@
<classpathentry kind="lib" path="thirdparty/jboss-common-core.jar"/>
<classpathentry kind="lib" path="thirdparty/jboss-dependency.jar"/>
<classpathentry kind="lib" path="thirdparty/jboss-logging-spi.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-4.2.x"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: branches/tdiesler/trunk/ant.properties.example
===================================================================
--- branches/tdiesler/trunk/ant.properties.example 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/ant.properties.example 2006-12-20 19:36:24 UTC (rev 1674)
@@ -3,7 +3,8 @@
#
# Required JBoss Home
-#jboss.jdk15.home=/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2
+#jboss50.home=/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2
+#jboss42.home=/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.CR1
# The JBoss server instance
jboss.server.instance=default
Modified: branches/tdiesler/trunk/build.xml
===================================================================
--- branches/tdiesler/trunk/build.xml 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/build.xml 2006-12-20 19:36:24 UTC (rev 1674)
@@ -34,7 +34,7 @@
<property name="build.samples.dir" value="${build.dir}/samples"/>
<property name="build.bin.dist" value="${build.dir}/bin-dist"/>
<property name="build.src.dist" value="${build.dir}/src-dist"/>
- <property name="build.api" value="${build.dir}/api"/>
+ <property name="build.api" value="${build.dir}/api"/>
<property name="docs.userguide.dir" value="${basedir}/docs/user-guide/project"/>
<property name="src.dir" value="${basedir}/src/main"/>
<property name="src.etc.dir" value="${src.dir}/etc"/>
@@ -49,15 +49,21 @@
<property name="thirdparty.dir" value="${basedir}/thirdparty"/>
- <property name="jboss.home" value="${jboss.jdk15.home}"/>
- <property name="jboss.lib" value="${jboss.home}/lib"/>
- <property name="jboss.client" value="${jboss.home}/client"/>
- <property name="jboss.server" value="${jboss.home}/server/${jboss.server.instance}"/>
- <property name="jboss.server.lib" value="${jboss.server}/lib"/>
- <property name="jboss.server.deploy" value="${jboss.server}/deploy"/>
- <property name="jboss.server.deployers" value="${jboss.server}/deployers"/>
- <property name="jboss.thirdparty" value="${jboss.home}/../../../thirdparty"/>
+ <property name="jboss50.lib" value="${jboss50.home}/lib"/>
+ <property name="jboss50.client" value="${jboss50.home}/client"/>
+ <property name="jboss50.server" value="${jboss50.home}/server/${jboss.server.instance}"/>
+ <property name="jboss50.server.lib" value="${jboss50.server}/lib"/>
+ <property name="jboss50.server.deploy" value="${jboss50.server}/deploy"/>
+ <property name="jboss50.server.deployers" value="${jboss50.server}/deployers"/>
+ <property name="jboss50.thirdparty" value="${jboss50.home}/../../../thirdparty"/>
+ <property name="jboss42.lib" value="${jboss42.home}/lib"/>
+ <property name="jboss42.client" value="${jboss42.home}/client"/>
+ <property name="jboss42.server" value="${jboss42.home}/server/${jboss.server.instance}"/>
+ <property name="jboss42.server.lib" value="${jboss42.server}/lib"/>
+ <property name="jboss42.server.deploy" value="${jboss42.server}/deploy"/>
+ <property name="jboss42.thirdparty" value="${jboss42.home}/../../../thirdparty"/>
+
<property name="tomcat.webapps.dir" value="${tomcat.home}/webapps"/>
<property name="tomcat.common.dir" value="${tomcat.home}/common"/>
@@ -67,16 +73,17 @@
<target name="prepare">
- <echo message="jboss.jdk15.home = ${jboss.jdk15.home}"/>
+ <echo message="jboss50.home = ${jboss50.home}"/>
+ <echo message="jboss42.home = ${jboss42.home}"/>
<echo message="tomcat.home = ${tomcat.home}"/>
<echo/>
<available property="jbossws.portal.content.available" file="${jbossws.portal.content}" type="dir"/>
- <available property="jboss.ejb3.available" file="${jboss.client}/jboss-ejb3-client.jar"/>
+ <available property="jboss50.ejb3.available" file="${jboss50.client}/jboss-ejb3-client.jar"/>
+ <available property="jboss42.ejb3.available" file="${jboss42.client}/jboss-ejb3-client.jar"/>
<available property="jbossws.thirdparty.available" file="${build.lib.dir}/jbossws-thirdparty.jar"/>
<available property="jboss.source.dist.available" file="${jboss.thirdparty}" type="dir"/>
<available property="tomcat.available" file="${tomcat.home}/server/lib/catalina.jar"/>
- <available property="jboss.available" file="${jboss.client}/jboss-client.jar"/>
<checksum file="version.properties" fileext=".md5" verifyproperty="checksum.ok"/>
<checksum file="version.properties" fileext=".md5"/>
@@ -90,7 +97,8 @@
</or>
</condition>
- <fail message="Not available: ${jboss.client}/jboss-ejb3-client.jar" unless="jboss.ejb3.available"/>
+ <fail message="Not available: ${jboss50.client}/jboss-ejb3-client.jar" unless="jboss50.ejb3.available"/>
+ <fail message="Not available: ${jboss42.client}/jboss-ejb3-client.jar" unless="jboss42.ejb3.available"/>
<tstamp>
<format property="build.id" pattern="yyyyMMddHHmm"/>
@@ -106,13 +114,6 @@
<path refid="jboss.core.classpath"/>
</path>
- <!-- The combined integration classpath -->
- <path id="integration.classpath">
- <path refid="library.classpath"/>
- <path refid="jboss.core.classpath"/>
- <path refid="jboss.integration.classpath"/>
- </path>
-
</target>
<!-- ================================================================== -->
@@ -157,16 +158,38 @@
</javac>
</target>
- <!-- Compile interation java sources -->
- <target name="compile-integration" depends="compile-core">
+ <!-- Compile integration java sources -->
+ <target name="compile-integration" depends="compile-jboss50-integration,compile-jboss42-integration,compile-tomcat-integration"/>
+ <target name="compile-jboss50-integration" depends="compile-core">
<mkdir dir="${build.classes.dir}"/>
<javac srcdir="${src.java.dir}" sourcepath="" destdir="${build.classes.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
- <include name="org/jboss/ws/integration/**"/>
+ <include name="org/jboss/ws/integration/jboss50/**"/>
<classpath path="${build.classes14.dir}"/>
- <classpath refid="integration.classpath"/>
+ <classpath refid="jboss50.integration.classpath"/>
+ <classpath refid="core.classpath"/>
</javac>
</target>
+ <target name="compile-jboss42-integration" depends="compile-core">
+ <mkdir dir="${build.classes.dir}"/>
+ <javac srcdir="${src.java.dir}" sourcepath="" destdir="${build.classes.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
+ deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
+ <include name="org/jboss/ws/integration/jboss42/**"/>
+ <classpath path="${build.classes14.dir}"/>
+ <classpath refid="jboss42.integration.classpath"/>
+ <classpath refid="core.classpath"/>
+ </javac>
+ </target>
+ <target name="compile-tomcat-integration" depends="compile-core">
+ <mkdir dir="${build.classes.dir}"/>
+ <javac srcdir="${src.java.dir}" sourcepath="" destdir="${build.classes.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
+ deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
+ <include name="org/jboss/ws/integration/tomcat/**"/>
+ <classpath path="${build.classes14.dir}"/>
+ <classpath refid="tomcat.integration.classpath"/>
+ <classpath refid="core.classpath"/>
+ </javac>
+ </target>
<!-- Compile etc files (manifests and such) -->
<target name="compile-etc" depends="init">
@@ -246,14 +269,22 @@
</fileset>
</jar>
- <!-- Build jbossws-jboss-integration.jar -->
- <jar jarfile="${build.lib.dir}/jbossws-jboss-integration.jar" manifest="${build.etc.dir}/default.mf">
+ <!-- Build jbossws-jboss50-integration.jar -->
+ <jar jarfile="${build.lib.dir}/jbossws-jboss50-integration.jar" manifest="${build.etc.dir}/default.mf">
<fileset dir="${build.classes.dir}">
<include name="org/jboss/ws/integration/*.class"/>
<include name="org/jboss/ws/integration/jboss50/**"/>
</fileset>
</jar>
+ <!-- Build jbossws-jboss42-integration.jar -->
+ <jar jarfile="${build.lib.dir}/jbossws-jboss42-integration.jar" manifest="${build.etc.dir}/default.mf">
+ <fileset dir="${build.classes.dir}">
+ <include name="org/jboss/ws/integration/*.class"/>
+ <include name="org/jboss/ws/integration/jboss42/**"/>
+ </fileset>
+ </jar>
+
<!-- Build jbossws-tomcat-integration.jar -->
<jar jarfile="${build.lib.dir}/jbossws-tomcat-integration.jar" manifest="${build.etc.dir}/default.mf">
<fileset dir="${build.classes.dir}">
Modified: branches/tdiesler/trunk/src/ant/build-thirdparty.xml
===================================================================
--- branches/tdiesler/trunk/src/ant/build-thirdparty.xml 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/ant/build-thirdparty.xml 2006-12-20 19:36:24 UTC (rev 1674)
@@ -96,23 +96,37 @@
<!-- The classpath for the jbossws core -->
<path id="jboss.core.classpath">
- <pathelement location="${jboss.server.lib}/jboss-j2ee.jar"/>
- <pathelement location="${jboss.server.deployers}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
- <pathelement location="${jboss.server.deployers}/ejb3.deployer/jboss-ejb3x.jar"/>
- <pathelement location="${jboss.server.deployers}/ejb3.deployer/jboss-ejb3.jar"/>
+ <pathelement location="${jboss50.server.lib}/jboss-j2ee.jar"/>
+ <pathelement location="${jboss50.server.deployers}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
+ <pathelement location="${jboss50.server.deployers}/ejb3.deployer/jboss-ejb3x.jar"/>
+ <pathelement location="${jboss50.server.deployers}/ejb3.deployer/jboss-ejb3.jar"/>
</path>
- <!-- The classpath for the jboss integration -->
- <path id="jboss.integration.classpath">
- <pathelement location="${jboss.lib}/jboss-j2se.jar"/>
- <pathelement location="${jboss.lib}/jboss-jmx.jar"/>
- <pathelement location="${jboss.lib}/jboss-mbeans.jar"/>
- <pathelement location="${jboss.lib}/jboss-system.jar"/>
- <pathelement location="${jboss.server.lib}/jboss.jar"/>
- <pathelement location="${jboss.server.lib}/jboss-security-spi.jar"/>
- <pathelement location="${jboss.server.deployers}/jboss-aop-jboss5.deployer/jboss-aop-jdk50.jar"/>
- <pathelement location="${jboss.server.deployers}/jboss-aop-jboss5.deployer/jboss-aspect-library-jdk50.jar"/>
+ <!-- The classpath for the jboss50 integration -->
+ <path id="jboss50.integration.classpath">
+ <pathelement location="${jboss50.lib}/jboss-j2se.jar"/>
+ <pathelement location="${jboss50.lib}/jboss-jmx.jar"/>
+ <pathelement location="${jboss50.lib}/jboss-mbeans.jar"/>
+ <pathelement location="${jboss50.lib}/jboss-system.jar"/>
+ <pathelement location="${jboss50.server.lib}/jboss.jar"/>
+ <pathelement location="${jboss50.server.lib}/jboss-security-spi.jar"/>
+ <pathelement location="${jboss50.server.deployers}/jboss-aop-jboss5.deployer/jboss-aop-jdk50.jar"/>
+ <pathelement location="${jboss50.server.deployers}/jboss-aop-jboss5.deployer/jboss-aspect-library-jdk50.jar"/>
</path>
+
+ <!-- The classpath for the jboss42 integration -->
+ <path id="jboss42.integration.classpath">
+ <pathelement location="${jboss42.lib}/jboss-jmx.jar"/>
+ <pathelement location="${jboss42.lib}/jboss-system.jar"/>
+ <pathelement location="${jboss42.server.lib}/jboss.jar"/>
+ <pathelement location="${jboss42.server.lib}/jbosssx.jar"/>
+ <pathelement location="${jboss42.server.lib}/jboss-j2ee.jar"/>
+ <pathelement location="${jboss42.server.deploy}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
+ <pathelement location="${jboss42.server.deploy}/ejb3.deployer/jboss-ejb3.jar"/>
+ <pathelement location="${jboss42.server.deploy}/ejb3.deployer/jboss-ejb3x.jar"/>
+ <pathelement location="${jboss42.server.deploy}/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+ <pathelement location="${jboss42.server.deploy}/jboss-aop-jdk50.deployer/jboss-aspect-library-jdk50.jar"/>
+ </path>
</target>
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -72,9 +72,9 @@
this.servletName = servletName;
}
- public abstract String publishServiceEndpoint(URL warURL) throws Exception;
+ public abstract String publishServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception;
- public abstract String destroyServiceEndpoint(URL warURL) throws Exception;
+ public abstract String destroyServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception;
public URL rewriteWarWebXml(URL warURL)
{
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -26,9 +26,14 @@
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Map;
+import javax.management.ObjectName;
+
+import org.jboss.mx.loading.RepositoryClassLoader;
+
/**
* The container independent deployment info.
*
@@ -66,6 +71,13 @@
/** An arbitrary map of state associated with the deployment */
public Map<String, Object> context = new HashMap<String, Object>();
+ // [TODO] unify jboss42 properties
+ public URL localUrl;
+ public URLClassLoader annotationsCl;
+ public URLClassLoader localCl;
+ public RepositoryClassLoader ucl;
+ public ObjectName deployedObject;
+
/** The sortName concatenated with the canonical names of all parents. */
public String getCanonicalName()
{
@@ -109,8 +121,8 @@
StringBuilder builder = new StringBuilder();
builder.append("[");
builder.append("type=" + type);
- builder.append(",shortName=" + simpleName);
- builder.append(",url=" + name);
+ builder.append(",simpleName=" + simpleName);
+ builder.append(",url=" + url);
builder.append("]");
return builder.toString();
}
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+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.metadata.WebMetaData;
+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
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class ApplicationMetaDataAdaptor
+{
+ public static UnifiedApplicationMetaData buildUnifiedApplicationMetaData(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;
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ApplicationMetaDataAdaptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,183 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+//$Id$
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerInterceptorSupport;
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.mx.server.Invocation;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.ws.core.server.KernelLocator;
+import org.jboss.ws.core.server.ServiceEndpointDeployer;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+
+/**
+ * A deployer service that manages WS4EE compliant Web Services
+ *
+ * This service is called from the {@see org.jboss.ws.metadata.WebServiceInterceptor}
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Dimitris.Andreadis(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public abstract class DeployerInterceptor extends SubDeployerInterceptorSupport
+{
+ // The main deployer
+ private MainDeployerMBean mainDeployer;
+
+ /** Create the deployer service
+ */
+ protected void createService() throws Exception
+ {
+ mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server);
+ super.attach();
+ }
+
+ /** Destroy the deployer service
+ */
+ protected void destroyService()
+ {
+ super.detach();
+ }
+
+ /** Overwrite to create the webservice
+ */
+ protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("create: " + di.url);
+
+ Object retn = invokeNext(invocation);
+
+ if (isWebserviceDeployment(di))
+ {
+ UnifiedDeploymentInfo udi = createUnifiedDeploymentInfo(di);
+ di.context.put(UnifiedDeploymentInfo.class.getName(), udi);
+ getServiceEndpointDeployer().create(udi);
+ }
+
+ return retn;
+ }
+
+ /** Overwrite to start the webservice
+ */
+ protected Object start(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("start: " + di.url);
+
+ Object retn = invokeNext(invocation);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ // late initialization of the web context loader
+ if (di.metaData instanceof WebMetaData)
+ {
+ ClassLoader classLoader = ((WebMetaData)di.metaData).getContextLoader();
+ udi.classLoader = classLoader;
+ }
+
+ getServiceEndpointDeployer().start(udi);
+ }
+
+ return retn;
+ }
+
+ /** Overwrite to stop the webservice
+ */
+ protected Object stop(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("stop: " + di.url);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ getServiceEndpointDeployer().stop(udi);
+ }
+
+ return invokeNext(invocation);
+ }
+
+ /** Overwrite to destroy the webservice
+ */
+ protected Object destroy(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ log.debug("destroy: " + di.url);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ getServiceEndpointDeployer().destroy(udi);
+ }
+
+ return invokeNext(invocation);
+ }
+
+ protected ServiceEndpointDeployer getServiceEndpointDeployer()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ KernelRegistryEntry entry = registry.getEntry(ServiceEndpointDeployer.BEAN_NAME);
+ return (ServiceEndpointDeployer)entry.getTarget();
+ }
+
+ protected ServiceEndpointPublisher getServiceEndpointPublisher()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ KernelRegistryEntry entry = registry.getEntry(ServiceEndpointPublisher.BEAN_NAME);
+ return (ServiceEndpointPublisher)entry.getTarget();
+ }
+
+ /** Return true if the deployment contains a web service endpoint
+ */
+ protected abstract boolean isWebserviceDeployment(DeploymentInfo di);
+
+ protected abstract UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws Throwable;
+
+ protected UnifiedDeploymentInfo getServiceEndpointDeployment(DeploymentInfo di)
+ {
+ return (UnifiedDeploymentInfo)di.context.get(UnifiedDeploymentInfo.class.getName());
+ }
+
+ /** Handle all webservice deployment exceptions.
+ * You can either simply logs the problem and keep the EJB/WAR module
+ * alive or undeploy properly.
+ */
+ protected void handleStartupException(DeploymentInfo di, Throwable th)
+ {
+ log.error("Cannot startup webservice for: " + di.shortName, th);
+ mainDeployer.undeploy(di);
+ }
+
+ /** Handle all webservice deployment exceptions.
+ *
+ * You can either simply logs the problem and keep the EJB/WAR module
+ * alive or undeploy properly.
+ */
+ protected void handleShutdownException(String moduleName, Throwable th)
+ {
+ log.error("Cannot shutdown webservice for: " + moduleName, th);
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+//$Id$
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.mx.server.Invocation;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web-Services for EJB Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public abstract class DeployerInterceptorEJB extends DeployerInterceptor
+{
+ protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ Object retObj = super.create(invocation, di);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
+ udi.localUrl = generateWebDeployment(di, wsMetaData);
+ udi.context.put(DeploymentInfo.class.getName(), di);
+ getServiceEndpointPublisher().publishServiceEndpoint(udi);
+ }
+
+ return retObj;
+ }
+
+ protected abstract URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData) throws IOException;
+
+ protected Object destroy(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ getServiceEndpointPublisher().destroyServiceEndpoint(udi);
+ }
+
+ return super.destroy(invocation, di);
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+//$Id$
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Iterator;
+
+import org.jboss.deployment.DeploymentInfo;
+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.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web-Services for EJB-2.1 Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public class DeployerInterceptorEJB21 extends DeployerInterceptorEJB implements DeployerInterceptorEJB21MBean
+{
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws Exception
+ {
+ UnifiedDeploymentInfo udi;
+ URL webservicesURL = getWebservicesDescriptor(di);
+ if (webservicesURL != null)
+ {
+ udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_EJB21, webservicesURL);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+ }
+ else
+ {
+ udi = new JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_EJB21);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+ }
+ return udi;
+ }
+
+ /** Return true if the deployment is a web service endpoint
+ */
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ ApplicationMetaData applMetaData = (ApplicationMetaData)di.metaData;
+ boolean isWebserviceDeployment = applMetaData.isWebServiceDeployment();
+
+ // Check if we have a webservices.xml descriptor
+ if (isWebserviceDeployment == false)
+ {
+ isWebserviceDeployment = getWebservicesDescriptor(di) != null;
+ }
+
+ // Check if the ejb-jar contains annotated endpoints
+ if (isWebserviceDeployment == false)
+ {
+ try
+ {
+ Iterator itBeans = applMetaData.getEnterpriseBeans();
+ while (itBeans.hasNext() && isWebserviceDeployment == false)
+ {
+ BeanMetaData beanMetaData = (BeanMetaData)itBeans.next();
+ String ejbClassName = beanMetaData.getEjbClass();
+ Class ejbClass = di.annotationsCl.loadClass(ejbClassName);
+ isWebserviceDeployment = ejbClass.isAnnotationPresent(javax.jws.WebService.class);
+ }
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw new WSException(e);
+ }
+ }
+
+ applMetaData.setWebServiceDeployment(isWebserviceDeployment);
+ return isWebserviceDeployment;
+ }
+
+ /**
+ * Get the resource name of the webservices.xml descriptor.
+ */
+ protected URL getWebservicesDescriptor(DeploymentInfo di)
+ {
+ return di.localCl.findResource("META-INF/webservices.xml");
+ }
+
+ protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData) throws IOException
+ {
+ ServiceEndpointGeneratorEJB21 generator = new ServiceEndpointGeneratorEJB21();
+ return generator.generatWebDeployment(di, wsMetaData);
+ }
+
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.integration.jboss42;
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.SubDeployerInterceptorMBean;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface DeployerInterceptorEJB21MBean extends SubDeployerInterceptorMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerEJB21");
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB21MBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+
+import javax.jws.WebService;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.ejb3.Ejb3ModuleMBean;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.JAXWSDeployment;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web-Services for EJB3 Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public class DeployerInterceptorEJB3 extends DeployerInterceptorEJB implements DeployerInterceptorEJB3MBean
+{
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws Exception
+ {
+ UnifiedDeploymentInfo udi = new JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_EJB3);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
+
+ // The container objects below provide access to all of the ejb metadata
+ ArrayList<UnifiedBeanMetaData> beans = new ArrayList<UnifiedBeanMetaData>();
+ for (Object container : ejb3Module.getContainers().values())
+ {
+ if (container instanceof StatelessContainer)
+ {
+ StatelessContainer slc = (StatelessContainer)container;
+ UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
+ uslc.setEjbName(slc.getEjbName());
+ uslc.setEjbClass(slc.getBeanClassName());
+ beans.add(uslc);
+ }
+ }
+
+ UnifiedApplicationMetaData appMetaData = new UnifiedApplicationMetaData();
+ appMetaData.setEnterpriseBeans(beans);
+ udi.metaData = appMetaData;
+
+ return udi;
+ }
+
+ /** Return true if the deployment is a web service endpoint
+ */
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ boolean isWebserviceDeployment = false;
+
+ // Check if the ejb3 contains annotated endpoints
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(di.deployedObject);
+ for (Object manager : ejb3Module.getContainers().values())
+ {
+ if (manager instanceof StatelessContainer)
+ {
+ StatelessContainer container = (StatelessContainer)manager;
+ if (container.resolveAnnotation(WebService.class) != null)
+ {
+ isWebserviceDeployment = true;
+ break;
+ }
+ }
+ }
+
+ return isWebserviceDeployment;
+ }
+
+ private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
+ {
+ Ejb3ModuleMBean ejb3Module;
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName, server);
+ if (ejb3Module == null)
+ throw new WSException("Cannot obtain EJB3 module: " + objectName);
+
+ return ejb3Module;
+ }
+ catch (MBeanProxyCreationException ex)
+ {
+ throw new WSException("Cannot obtain proxy to EJB3 module");
+ }
+ }
+
+ protected URL generateWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData) throws IOException
+ {
+ return new ServiceEndpointGeneratorEJB3().generatWebDeployment(di, wsMetaData);
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.integration.jboss42;
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.SubDeployerInterceptorMBean;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface DeployerInterceptorEJB3MBean extends SubDeployerInterceptorMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerEJB3");
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3MBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,161 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.mx.server.Invocation;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.JAXWSDeployment;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+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.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * A deployer service that manages WS4EE compliant Web Services for WAR
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public class DeployerInterceptorJSE extends DeployerInterceptor implements DeployerInterceptorJSEMBean
+{
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws Exception
+ {
+ UnifiedDeploymentInfo udi;
+
+ 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);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+
+ }
+ else if (type == UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE)
+ {
+ udi = new JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+ }
+ else
+ {
+ throw new WSException("Unexpected type: " + type);
+ }
+
+ return udi;
+ }
+
+ /** Overwrite to create the webservice
+ *
+ * This implemantation modifies the servlet entries in web.xml
+ */
+ protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable
+ {
+ Object retn = super.create(invocation, di);
+
+ UnifiedDeploymentInfo udi = getServiceEndpointDeployment(di);
+ if (udi != null)
+ {
+ ServiceEndpointPublisher endpointPublisher = getServiceEndpointPublisher();
+ Map<String, String> sepTargetMap = endpointPublisher.rewriteWebXml(udi);
+ updateServiceEndpointTargetBeans(udi, sepTargetMap);
+ }
+ return retn;
+ }
+
+ private void updateServiceEndpointTargetBeans(UnifiedDeploymentInfo udi, Map<String, String> sepTargetMap)
+ {
+ UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
+
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String targetBean = sepTargetMap.get(sepMetaData.getLinkName());
+ sepMetaData.setServiceEndpointImplName(targetBean);
+ }
+ }
+ }
+
+ /** Return true if the deployment is a web service endpoint
+ */
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ WebMetaData webMetaData = (WebMetaData)di.metaData;
+ boolean isWebserviceDeployment = webMetaData.isWebServiceDeployment();
+
+ // Check if we have a webservices.xml descriptor
+ if (isWebserviceDeployment == false)
+ {
+ if (getWebservicesDescriptor(di) != null)
+ {
+ di.context.put("UnifiedDeploymentInfo.Type", UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE);
+ isWebserviceDeployment = true;
+ }
+ }
+
+ // Check if the web.xml contains annotated endpoint impl
+ if (isWebserviceDeployment == false)
+ {
+ Map servletClassMap = webMetaData.getServletClassMap();
+ Iterator<String> it = servletClassMap.values().iterator();
+ while (it.hasNext() && isWebserviceDeployment == false)
+ {
+ String servletClassName = it.next();
+ try
+ {
+ Class servletClass = di.annotationsCl.loadClass(servletClassName);
+ if (servletClass.isAnnotationPresent(javax.jws.WebService.class))
+ {
+ di.context.put("UnifiedDeploymentInfo.Type", UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
+ isWebserviceDeployment = true;
+ }
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ }
+ }
+ }
+
+ webMetaData.setWebServiceDeployment(isWebserviceDeployment);
+ return isWebserviceDeployment;
+ }
+
+ /**
+ * Get the resource name of the webservices.xml descriptor.
+ */
+ protected URL getWebservicesDescriptor(DeploymentInfo di)
+ {
+ return di.localCl.findResource("WEB-INF/webservices.xml");
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.integration.jboss42;
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.SubDeployerInterceptorMBean;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface DeployerInterceptorJSEMBean extends SubDeployerInterceptorMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerJSE");
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSEMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,132 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerSupport;
+import org.jboss.system.server.ServerConfig;
+import org.jboss.system.server.ServerConfigLocator;
+import org.jboss.ws.core.utils.IOUtils;
+
+/**
+ * A deployer service that manages WS4EE compliant Web Services for
+ * nested POJO endpoints.
+ *
+ * The WebServiceDeployerJSE attaches itself as an deployment interceptor to
+ * the jboss.web:service=WebServer deployer. As a consequence, all *.war deployments
+ * that are picked up before the interceptor is installed are not treated as potential
+ * web service endpoint deployments.
+ *
+ * Nested POJO endpoints can be packaged in *.jse deployments that are then picked up by this
+ * deployer.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 03-Mar-2005
+ */
+public class DeployerInterceptorNestedJSE extends SubDeployerSupport implements DeployerInterceptorNestedJSEMBean
+{
+ private static final String NESTED_JSE_WAR_FILE = "org.jboss.ws.server.nested.jse";
+
+ // The MainDeployer
+ protected MainDeployerMBean mainDeployer;
+
+ public void setMainDeployer(MainDeployerMBean mainDeployer)
+ {
+ this.mainDeployer = mainDeployer;
+ }
+
+ public boolean accepts(DeploymentInfo sdi)
+ {
+ setSuffixes(new String[] { ".jse" });
+ return super.accepts(sdi);
+ }
+
+ /** Copy the *.jse to a *.war and deploy through the main deployer
+ */
+ public void create(DeploymentInfo di) throws DeploymentException
+ {
+ log.debug("create: " + di.url);
+
+ try
+ {
+ File jseFile = new File(di.localUrl.getFile());
+ if (jseFile.isFile() == false)
+ throw new DeploymentException("Expected a file: " + di.localUrl);
+
+ ServerConfig config = ServerConfigLocator.locate();
+ String warFileName = config.getServerTempDir().getCanonicalPath() + "/deploy/" + di.shortName;
+ warFileName = warFileName.substring(0, warFileName.length() - 4) + ".war";
+ File warFile = new File(warFileName);
+
+ FileOutputStream fos = new FileOutputStream(warFile);
+ FileInputStream fis = new FileInputStream(jseFile);
+ try
+ {
+ IOUtils.copyStream(fos, fis);
+ }
+ finally
+ {
+ fos.close();
+ fis.close();
+ }
+
+ mainDeployer.deploy(warFile.toURL());
+
+ // remember the war url that we deployed
+ di.context.put(NESTED_JSE_WAR_FILE, warFile);
+
+ super.create(di);
+ }
+ catch (IOException ex)
+ {
+ throw new DeploymentException("Failed to create: " + di.url, ex);
+ }
+ }
+
+ /** Undeploy the *.war through the main deployer
+ */
+ public void destroy(DeploymentInfo di) throws DeploymentException
+ {
+ log.debug("destroy: " + di.url);
+ try
+ {
+ File warFile = (File)di.context.get(NESTED_JSE_WAR_FILE);
+ mainDeployer.undeploy(warFile.toURL());
+ warFile.delete();
+
+ super.destroy(di);
+ }
+ catch (IOException ex)
+ {
+ throw new DeploymentException("Failed to destroy: " + di.url, ex);
+ }
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerMBean;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 03-Mar-2005
+ */
+public interface DeployerInterceptorNestedJSEMBean extends SubDeployerMBean
+{
+ //default object name
+ public static final ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=WebServiceDeployerNestedJSE");
+
+ void setMainDeployer(MainDeployerMBean mainDeployer);
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorNestedJSEMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+
+/**
+ * Build container independent deployment info.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class DeploymentInfoAdaptor
+{
+ public static UnifiedDeploymentInfo buildDeploymentInfo(UnifiedDeploymentInfo udi, DeploymentInfo di)
+ {
+ if (di.parent != null)
+ {
+ udi.parent = new UnifiedDeploymentInfo(null);
+ buildDeploymentInfo(udi.parent, di.parent);
+ }
+
+ udi.simpleName = di.shortName;
+ udi.url = di.url;
+ udi.localUrl = di.localUrl;
+ udi.metaData = buildMetaData(di.metaData);
+ udi.annotationsCl = di.annotationsCl;
+ udi.localCl = di.localCl;
+ udi.ucl = di.ucl;
+ udi.deployedObject = di.deployedObject;
+
+ return udi;
+ }
+
+ private static Object buildMetaData(Object metaData)
+ {
+ Object retMetaData = null;
+ if (metaData instanceof WebMetaData)
+ {
+ retMetaData = WebMetaDataAdaptor.buildUnifiedWebMetaData((WebMetaData)metaData);
+ }
+ else if (metaData instanceof ApplicationMetaData)
+ {
+ retMetaData = ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData((ApplicationMetaData)metaData);
+ }
+ return retMetaData;
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.CommonContextServlet;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+
+/**
+ * The servlet that that is associated with context /jbossws
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Mar-2005
+ */
+public class JBossContextServlet extends CommonContextServlet
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(JBossContextServlet.class);
+
+ protected void initServiceEndpointManager()
+ {
+ ServiceEndpointManagerFactory factory = ServiceEndpointManagerFactory.getInstance();
+ epManager = factory.getServiceEndpointManager();
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossContextServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointPublisher.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointPublisher.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointPublisher.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * Publish the HTTP service endpoint to Tomcat
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class JBossServiceEndpointPublisher extends ServiceEndpointPublisher
+{
+
+ public String publishServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
+ {
+ URL warURL = udi.localUrl;
+ DeploymentInfo di = (DeploymentInfo)udi.context.get(DeploymentInfo.class.getName());
+ if (di == null)
+ throw new IllegalStateException("Cannot obtain DeploymentInfo from context");
+
+ rewriteWebXML(udi);
+
+ // Preserve the repository config
+ DeploymentInfo auxdi = new DeploymentInfo(warURL, null, MBeanServerLocator.locateJBoss());
+ auxdi.repositoryConfig = di.getTopRepositoryConfig();
+ getMainDeployer().deploy(auxdi);
+ return "OK";
+ }
+
+ public String destroyServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
+ {
+ getMainDeployer().undeploy(udi.localUrl);
+ return "OK";
+ }
+
+ public Set<String> getWebServiceServletLinks(UnifiedDeploymentInfo udi)
+ {
+ Set<String> links = new HashSet<String>();
+
+ UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
+
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ links.add(sepMetaData.getLinkName());
+
+ }
+ }
+
+ return links;
+ }
+
+ private MainDeployerMBean getMainDeployer() throws MBeanProxyCreationException
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ MainDeployerMBean mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server);
+ return mainDeployer;
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointPublisher.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
+import org.jboss.ws.core.server.ServiceEndpoint;
+import org.jboss.ws.metadata.config.CommonConfig;
+import org.jboss.ws.metadata.config.ConfigurationProvider;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * A servlet that is installed for every web service endpoint.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-May-2006
+ */
+public class JBossServiceEndpointServlet extends AbstractServiceEndpointServlet
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(JBossServiceEndpointServlet.class);
+
+ /** Initialize the service endpoint
+ */
+ protected void initServiceEndpoint(String contextPath)
+ {
+ super.initServiceEndpoint(contextPath);
+
+ ServiceEndpoint wsEndpoint = epManager.getServiceEndpointByID(sepId);
+ if (wsEndpoint == null)
+ throw new WSException("Cannot obtain endpoint for: " + sepId);
+
+ // read the config name/file from web.xml
+ ServletContext ctx = getServletContext();
+ String configName = ctx.getInitParameter("jbossws-config-name");
+ String configFile = ctx.getInitParameter("jbossws-config-file");
+ if (configName != null || configFile != null)
+ {
+ log.debug("Updating service endpoint config\n config-name: " + configName + "\n config-file: " + configFile);
+ ServerEndpointMetaData sepMetaData = wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
+
+ ConfigurationProvider configProvider = (ConfigurationProvider)sepMetaData;
+ configProvider.setConfigName(configName);
+ configProvider.setConfigFile(configFile);
+
+ // configure handler chain
+ configProvider.configure(sepMetaData);
+
+ log.debug("Updated server meta data" + sepMetaData);
+ }
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.ServiceEndpoint;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+
+/**
+ * A servlet that reports the serviceURL for a given service ID.
+ * <p/>
+ * When the web service client ENC is setup, it may contain port-component-link
+ * entries that point to service endpoints in the same top level deployment.
+ * The final serviceURL of those endpoints will become available after the
+ * reference to the javax.xml.rpc.Service is bound to JNDI.
+ * <p/>
+ * When the client does a lookup of the javax.xml.rpc.Service from JNDI the ObjectFactory
+ * will contact this servlet for the final serviceURL. It is acceptable that the client
+ * wsdl does not contain the correct serviceURL if the client is using the port-component-link element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 29-May-2004
+ */
+public class PortComponentLinkServlet extends HttpServlet
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(PortComponentLinkServlet.class);
+
+ protected ServiceEndpointManager epManager;
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+ ServiceEndpointManagerFactory factory = ServiceEndpointManagerFactory.getInstance();
+ epManager = factory.getServiceEndpointManager();
+ }
+
+ /**
+ * Get the serviceURL as string for a given serviceID.
+ */
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ String pcLink = req.getParameter("pcLink");
+ if (pcLink == null)
+ throw new IllegalArgumentException("Cannot obtain request parameter 'pcLink'");
+
+ ServiceEndpoint serviceEndpoint = epManager.resolvePortComponentLink(pcLink);
+ ;
+ if (serviceEndpoint == null)
+ throw new WSException("Cannot resolve port-component-link: " + pcLink);
+
+ res.setContentType("text/plain");
+ PrintWriter out = res.getWriter();
+
+ String endpointAddress = serviceEndpoint.getServiceEndpointInfo().getServerEndpointMetaData().getEndpointAddress();
+ out.println(endpointAddress);
+
+ log.debug("Resolved " + pcLink + " to: " + endpointAddress);
+ out.close();
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/PortComponentLinkServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+//$Id$
+
+import java.io.File;
+import java.util.Set;
+
+import javax.management.AttributeNotFoundException;
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * JBoss specific implementation of a ServerConfig
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author darran.lofthouse(a)jboss.com
+ * @since 08-May-2006
+ */
+public class ServerConfigImpl implements ServerConfig
+{
+
+ private static final Logger log = Logger.getLogger(ServerConfigImpl.class);
+
+ public File getServerTempDir()
+ {
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File tmpdir = (File)server.getAttribute(oname, "ServerTempDir");
+ return tmpdir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public File getServerDataDir()
+ {
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File tmpdir = (File)server.getAttribute(oname, "ServerDataDir");
+ return tmpdir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public int getWebServicePort()
+ {
+ int port = getConnectorPort("HTTP/1.1", false);
+ if (port > -1)
+ {
+ return port;
+ }
+
+ log.warn("Unable to calculate 'WebServicePort', using default '8080'");
+ return 8080;
+ }
+
+ public int getWebServiceSecurePort()
+ {
+ int port = getConnectorPort("HTTP/1.1", true);
+ if (port > -1)
+ {
+ return port;
+ }
+
+ log.warn("Unable to calculate 'WebServiceSecurePort', using default '8443'");
+ return 8443;
+ }
+
+ private int getConnectorPort(final String protocol, final boolean secure)
+ {
+ int port = -1;
+
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
+
+ Set connectorNames = server.queryNames(connectors, null);
+ for (Object current : connectorNames)
+ {
+ ObjectName currentName = (ObjectName)current;
+
+ try
+ {
+ int connectorPort = (Integer)server.getAttribute(currentName, "port");
+ boolean connectorSecure = (Boolean)server.getAttribute(currentName, "secure");
+ String connectorProtocol = (String)server.getAttribute(currentName, "protocol");
+
+ if (protocol.equals(connectorProtocol) && secure == connectorSecure)
+ {
+ if (port > -1)
+ {
+ log.warn("Found multiple connectors for protocol='" + protocol + "' and secure='" + secure + "', using first port found '" + port + "'");
+ }
+ else
+ {
+ port = connectorPort;
+ }
+ }
+ }
+ catch (AttributeNotFoundException ignored)
+ {
+ }
+ }
+
+ return port;
+ }
+ catch (JMException e)
+ {
+ return -1;
+ }
+
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServerConfigImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,306 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+//$Id$
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.logging.Logger;
+import org.jboss.system.server.ServerConfig;
+import org.jboss.system.server.ServerConfigLocator;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a web deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public abstract class ServiceEndpointGeneratorEJB
+{
+ // logging support
+ protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB.class);
+
+ public URL generatWebDeployment(DeploymentInfo di, UnifiedMetaData wsMetaData) throws IOException
+ {
+ // Collect the list of PortComponentMetaData
+ List<EndpointMetaData> epMetaDataList = new ArrayList<EndpointMetaData>();
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ epMetaDataList.add(epMetaData);
+ }
+ }
+
+ Element webDoc = createWebAppDescriptor(di, epMetaDataList);
+ Element jbossDoc = createJBossWebAppDescriptor(di, epMetaDataList);
+
+ File tmpWar = null;
+ try
+ {
+ ServerConfig config = ServerConfigLocator.locate();
+ File tmpdir = new File(config.getServerTempDir().getCanonicalPath() + "/deploy");
+
+ String deploymentName = di.getCanonicalName().replace('/', '-') + "-ws";
+ tmpWar = File.createTempFile(deploymentName, ".war", tmpdir);
+ tmpWar.delete();
+ File webInf = new File(tmpWar, "WEB-INF");
+ webInf.mkdirs();
+
+ File webXml = new File(webInf, "web.xml");
+ FileWriter fw = new FileWriter(webXml);
+ new DOMWriter(fw).setPrettyprint(true).print(webDoc);
+ fw.close();
+
+ File jbossWebXml = new File(webInf, "jboss-web.xml");
+ fw = new FileWriter(jbossWebXml);
+ new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
+ fw.close();
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to create webservice.war", e);
+ }
+
+ return tmpWar.toURL();
+ }
+
+ private Element createWebAppDescriptor(DeploymentInfo di, List<EndpointMetaData> epMetaDataList)
+ {
+ Element webApp = DOMUtils.createElement("web-app");
+
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String ejbName = sepMetaData.getLinkName();
+ Element servlet = (Element)webApp.appendChild(DOMUtils.createElement("servlet"));
+ Element servletName = (Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode(ejbName));
+ Element servletClass = (Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
+ String targetBean = sepMetaData.getServiceEndpointImplName();
+ String seiName = sepMetaData.getServiceEndpointInterfaceName();
+ String servletClassName = (targetBean != null ? targetBean : seiName);
+ servletClass.appendChild(DOMUtils.createTextNode(servletClassName));
+ }
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ ArrayList<String> urlPatters = new ArrayList<String>();
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String ejbName = sepMetaData.getLinkName();
+ Element servletMapping = (Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
+ Element servletName = (Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
+ servletName.appendChild(DOMUtils.createTextNode(ejbName));
+ Element urlPatternElement = (Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
+
+ String urlPattern = "/*";
+ if (sepMetaData.getURLPattern() != null)
+ {
+ urlPattern = sepMetaData.getURLPattern();
+ }
+
+ if (urlPatters.contains(urlPattern))
+ throw new IllegalArgumentException("Cannot use the same url-pattern with different endpoints, " + "check your <port-component-uri> in jboss.xml");
+
+ urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
+ urlPatters.add(urlPattern);
+ }
+
+ String authMethod = null;
+
+ // Add web-app/security-constraint for each port component
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String ejbName = sepMetaData.getLinkName();
+ if (sepMetaData.getAuthMethod() != null || sepMetaData.getTransportGuarantee() != null)
+ {
+ /*
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>TestUnAuthPort</web-resource-name>
+ <url-pattern>/HSTestRoot/TestUnAuth/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>*</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ */
+ Element securityConstraint = (Element)webApp.appendChild(DOMUtils.createElement("security-constraint"));
+ Element wrc = (Element)securityConstraint.appendChild(DOMUtils.createElement("web-resource-collection"));
+ Element wrName = (Element)wrc.appendChild(DOMUtils.createElement("web-resource-name"));
+ wrName.appendChild(DOMUtils.createTextNode(ejbName));
+ Element pattern = (Element)wrc.appendChild(DOMUtils.createElement("url-pattern"));
+ String uri = sepMetaData.getURLPattern();
+ pattern.appendChild(DOMUtils.createTextNode(uri));
+ Element method = (Element)wrc.appendChild(DOMUtils.createElement("http-method"));
+ method.appendChild(DOMUtils.createTextNode("GET"));
+ method = (Element)wrc.appendChild(DOMUtils.createElement("http-method"));
+ method.appendChild(DOMUtils.createTextNode("POST"));
+
+ // Optional auth-constraint
+ if (sepMetaData.getAuthMethod() != null)
+ {
+ // Only the first auth-method gives the war login-config/auth-method
+ if (authMethod == null)
+ authMethod = sepMetaData.getAuthMethod();
+
+ Element authConstraint = (Element)securityConstraint.appendChild(DOMUtils.createElement("auth-constraint"));
+ Element roleName = (Element)authConstraint.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode("*"));
+ }
+ // Optional user-data-constraint
+ if (sepMetaData.getTransportGuarantee() != null)
+ {
+ Element userData = (Element)securityConstraint.appendChild(DOMUtils.createElement("user-data-constraint"));
+ Element transport = (Element)userData.appendChild(DOMUtils.createElement("transport-guarantee"));
+ transport.appendChild(DOMUtils.createTextNode(sepMetaData.getTransportGuarantee()));
+ }
+ }
+ }
+
+ // Optional login-config/auth-method
+ if (authMethod != null)
+ {
+ Element loginConfig = (Element)webApp.appendChild(DOMUtils.createElement("login-config"));
+ Element method = (Element)loginConfig.appendChild(DOMUtils.createElement("auth-method"));
+ method.appendChild(DOMUtils.createTextNode(authMethod));
+ Element realm = (Element)loginConfig.appendChild(DOMUtils.createElement("realm-name"));
+ realm.appendChild(DOMUtils.createTextNode("EJBServiceEndpointServlet Realm"));
+
+ addEJBSecurityRoles(di, webApp);
+ }
+
+ return webApp;
+ }
+
+ private Element createJBossWebAppDescriptor(DeploymentInfo di, List<EndpointMetaData> epMetaDataList)
+ {
+ /* Create a jboss-web
+ <jboss-web>
+ <security-domain>java:/jaas/cts</security-domain>
+ <context-root>/ws/ejbN/</context-root>
+ </jboss-web>
+ */
+ Element jbossWeb = DOMUtils.createElement("jboss-web");
+
+ UnifiedMetaData wsMetaData = epMetaDataList.get(0).getServiceMetaData().getUnifiedMetaData();
+ String securityDomain = wsMetaData.getSecurityDomain();
+ if (securityDomain != null)
+ {
+ Element secDomain = (Element)jbossWeb.appendChild(DOMUtils.createElement("security-domain"));
+ secDomain.appendChild(DOMUtils.createTextNode("java:/jaas/" + securityDomain));
+ }
+
+ // Get the context root for this deployment
+ String contextRoot = null;
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String next = sepMetaData.getContextRoot();
+ if (next != null)
+ {
+ if (contextRoot == null)
+ {
+ contextRoot = next;
+ }
+ else if (contextRoot.equals(next) == false)
+ {
+ throw new WSException("Multiple context root not supported");
+ }
+ }
+ }
+ if (contextRoot == null)
+ throw new WSException("Cannot obtain context root");
+
+ Element root = (Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
+ root.appendChild(DOMUtils.createTextNode(contextRoot));
+
+ String[] virtualHosts = null;
+ for (EndpointMetaData epMetaData : epMetaDataList)
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ String[] next = sepMetaData.getVirtualHosts();
+ if (next != null && next.length > 0)
+ {
+ Arrays.sort(next);
+ if (virtualHosts == null)
+ {
+ virtualHosts = next;
+ }
+ else
+ {
+ if (Arrays.equals(virtualHosts, next) == false)
+ {
+ throw new WSException("All endpoints must define the same virtual hosts");
+ }
+ }
+ }
+ }
+
+ if (virtualHosts != null)
+ {
+ for (String current : virtualHosts)
+ {
+ Element virtualHost = (Element)jbossWeb.appendChild(DOMUtils.createElement("virtual-host"));
+ virtualHost.appendChild(DOMUtils.createTextNode(current));
+ }
+ }
+
+ return jbossWeb;
+ }
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ protected abstract void addEJBSecurityRoles(DeploymentInfo di, Element webApp);
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB21.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB21.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB21.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+//$Id$
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.AssemblyDescriptorMetaData;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a service endpoint deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class ServiceEndpointGeneratorEJB21 extends ServiceEndpointGeneratorEJB
+{
+ // logging support
+ protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB21.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ protected void addEJBSecurityRoles(DeploymentInfo di, Element webApp)
+ {
+ // Fix: http://jira.jboss.org/jira/browse/JBWS-309
+ ApplicationMetaData applMetaData = (ApplicationMetaData)di.metaData;
+ AssemblyDescriptorMetaData assemblyDescriptor = applMetaData.getAssemblyDescriptor();
+ if (assemblyDescriptor != null)
+ {
+ Map securityRoles = assemblyDescriptor.getSecurityRoles();
+ if (securityRoles != null)
+ {
+ Iterator it = securityRoles.keySet().iterator();
+ while (it.hasNext())
+ {
+ Element securityRole = (Element)webApp.appendChild(DOMUtils.createElement("security-role"));
+ Element roleName = (Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode((String)it.next()));
+ }
+ }
+ }
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB21.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+//$Id$
+
+import javax.annotation.security.RolesAllowed;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.ejb3.Ejb3ModuleMBean;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.WSException;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a service endpoint deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class ServiceEndpointGeneratorEJB3 extends ServiceEndpointGeneratorEJB
+{
+ // logging support
+ protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB3.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ protected void addEJBSecurityRoles(DeploymentInfo di, Element webApp)
+ {
+ // The container objects below provide access to all of the ejb metadata
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(di.deployedObject);
+ for (Object manager : ejb3Module.getContainers().values())
+ {
+ if (manager instanceof StatelessContainer)
+ {
+ StatelessContainer container = (StatelessContainer)manager;
+
+ RolesAllowed anRolesAllowed = (RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
+ if (anRolesAllowed != null)
+ {
+ for (String role : anRolesAllowed.value())
+ {
+ Element securityRole = (Element)webApp.appendChild(DOMUtils.createElement("security-role"));
+ Element roleName = (Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode(role));
+ }
+ }
+ }
+ }
+ }
+
+ private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
+ {
+ Ejb3ModuleMBean ejb3Module;
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName, server);
+ if (ejb3Module == null)
+ throw new WSException("Cannot obtain EJB3 module: " + objectName);
+
+ return ejb3Module;
+ }
+ catch (MBeanProxyCreationException ex)
+ {
+ throw new WSException("Cannot obtain proxy to EJB3 module");
+ }
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInterceptor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInterceptor.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInterceptor.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,139 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ejb.plugins.AbstractInterceptor;
+import org.jboss.invocation.Invocation;
+import org.jboss.invocation.InvocationKey;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.CommonBinding;
+import org.jboss.ws.core.CommonBindingProvider;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * This Interceptor does the ws4ee handler processing.
+ *
+ * According to the ws4ee spec the handler logic must be invoked after the container
+ * applied method level security to the invocation.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Sep-2005
+ */
+public class ServiceEndpointInterceptor extends AbstractInterceptor
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(ServiceEndpointInterceptor.class);
+
+ // Interceptor implementation --------------------------------------
+
+ /** Before and after we call the service endpoint bean, we process the handler chains.
+ */
+ public Object invoke(final Invocation mi) throws Exception
+ {
+ // If no msgContext, it's not for us
+ CommonMessageContext msgContext = (CommonMessageContext)mi.getPayloadValue(InvocationKey.SOAP_MESSAGE_CONTEXT);
+ if (msgContext == null)
+ {
+ return getNext().invoke(mi);
+ }
+
+ // Get the endpoint invocation
+ EndpointInvocation epInv = (EndpointInvocation)mi.getValue(EndpointInvocation.class.getName());
+ OperationMetaData opMetaData = epInv.getOperationMetaData();
+
+ // Get the handler callback
+ String key = ServiceEndpointInvokerEJB21.HandlerCallback.class.getName();
+ ServiceEndpointInvokerEJB21.HandlerCallback callback = (ServiceEndpointInvokerEJB21.HandlerCallback)mi.getValue(key);
+
+ // Handlers need to be Tx. Therefore we must invoke the handler chain after the TransactionInterceptor.
+ if (callback != null && epInv != null)
+ {
+ try
+ {
+ // call the request handlers
+ boolean handlersPass = callback.callRequestHandlerChain(HandlerType.ENDPOINT);
+ handlersPass = handlersPass && callback.callRequestHandlerChain(HandlerType.POST);
+
+ // Call the next interceptor in the chain
+ if (handlersPass)
+ {
+ // The SOAPContentElements stored in the EndpointInvocation might have changed after
+ // handler processing. Get the updated request payload. This should be a noop if request
+ // handlers did not modify the incomming SOAP message.
+ Object[] reqParams = epInv.getRequestPayload();
+ mi.setArguments(reqParams);
+ Object resObj = getNext().invoke(mi);
+ epInv.setReturnValue(resObj);
+
+ // Bind the response message
+ CommonBindingProvider bindingProvider = new CommonBindingProvider(opMetaData.getEndpointMetaData());
+ CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();
+ SOAPMessage resMessage = (SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
+ msgContext.setSOAPMessage(resMessage);
+ }
+
+ // call the response handlers
+ handlersPass = callback.callResponseHandlerChain(HandlerType.POST);
+ handlersPass = handlersPass && callback.callResponseHandlerChain(HandlerType.ENDPOINT);
+
+ // update the return value after response handler processing
+ Object resObj = epInv.getReturnValue();
+
+ return resObj;
+ }
+ catch (Exception ex)
+ {
+ try
+ {
+ SOAPMessage faultMessage = SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
+ msgContext.setSOAPMessage(faultMessage);
+
+ // call the fault handlers
+ boolean handlersPass = callback.callFaultHandlerChain(HandlerType.POST, ex);
+ handlersPass = handlersPass && callback.callFaultHandlerChain(HandlerType.ENDPOINT, ex);
+ }
+ catch (Exception subEx)
+ {
+ log.warn("Cannot process handlerChain.handleFault, ignoring: ", subEx);
+ }
+ throw ex;
+ }
+ finally
+ {
+ // do nothing
+ }
+ }
+ else
+ {
+ log.warn("Handler callback not available");
+ return getNext().invoke(mi);
+ }
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,263 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.lang.reflect.Method;
+import java.security.Principal;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.ejb.EjbModule;
+import org.jboss.ejb.Interceptor;
+import org.jboss.ejb.StatelessSessionContainer;
+import org.jboss.invocation.Invocation;
+import org.jboss.invocation.InvocationKey;
+import org.jboss.invocation.InvocationType;
+import org.jboss.invocation.PayloadKey;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.security.SecurityAssociation;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
+import org.jboss.ws.core.server.ServiceEndpointInfo;
+import org.jboss.ws.core.server.ServiceEndpointInvoker;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * Handles invocations on EJB2.1 endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-Jan-2005
+ */
+public class ServiceEndpointInvokerEJB21 extends AbstractServiceEndpointInvoker implements ServiceEndpointInvoker
+{
+ // provide logging
+ private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB21.class);
+
+ private String jndiName;
+ private MBeanServer server;
+ private ObjectName objectName;
+
+ public ServiceEndpointInvokerEJB21()
+ {
+ server = MBeanServerLocator.locateJBoss();
+ }
+
+ /** Initialize the service endpoint */
+ @Override
+ public void initServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ super.initServiceEndpoint(seInfo);
+
+ ServerEndpointMetaData epMetaData = seInfo.getServerEndpointMetaData();
+ String ejbName = epMetaData.getLinkName();
+ if (ejbName == null)
+ throw new WSException("Cannot obtain ejb-link from port component");
+
+ UnifiedApplicationMetaData applMetaData = (UnifiedApplicationMetaData)seInfo.getUnifiedDeploymentInfo().metaData;
+ UnifiedBeanMetaData beanMetaData = (UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
+ if (beanMetaData == null)
+ throw new WSException("Cannot obtain ejb meta data for: " + ejbName);
+
+ // verify the service endpoint
+ String seiName = epMetaData.getServiceEndpointInterfaceName();
+ if (epMetaData.getType() == Type.JAXRPC && seiName != null)
+ {
+ String bmdSEI = beanMetaData.getServiceEndpoint();
+ if (seiName.equals(bmdSEI) == false)
+ throw new WSException("Endpoint meta data defines SEI '" + seiName + "', <service-endpoint> in ejb-jar.xml defines '" + bmdSEI + "'");
+ }
+
+ // get the bean's JNDI name
+ jndiName = beanMetaData.getContainerObjectNameJndiName();
+ if (jndiName == null)
+ throw new WSException("Cannot obtain JNDI name for: " + ejbName);
+
+ objectName = ObjectNameFactory.create("jboss.j2ee:jndiName=" + jndiName + ",service=EJB");
+
+ // Dynamically add the service endpoint interceptor
+ // http://jira.jboss.org/jira/browse/JBWS-758
+ try
+ {
+ EjbModule ejbModule = (EjbModule)server.getAttribute(objectName, "EjbModule");
+ StatelessSessionContainer container = (StatelessSessionContainer)ejbModule.getContainer(ejbName);
+
+ boolean injectionPointFound = false;
+ Interceptor prev = container.getInterceptor();
+ while (prev != null && prev.getNext() != null)
+ {
+ Interceptor next = prev.getNext();
+ if (next.getNext() == null)
+ {
+ log.debug("Inject service endpoint interceptor after: " + prev.getClass().getName());
+ ServiceEndpointInterceptor sepInterceptor = new ServiceEndpointInterceptor();
+ prev.setNext(sepInterceptor);
+ sepInterceptor.setNext(next);
+ injectionPointFound = true;
+ }
+ prev = next;
+ }
+ if (injectionPointFound == false)
+ log.warn("Cannot service endpoint interceptor injection point");
+ }
+ catch (Exception ex)
+ {
+ log.warn("Cannot add service endpoint interceptor", ex);
+ }
+ }
+
+ /** Load the SEI implementation bean if necessary
+ */
+ public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ if (server.isRegistered(objectName) == false)
+ throw new WSException("Cannot find service endpoint target: " + objectName);
+
+ return null;
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object endpointContext, Class seiImplClass)
+ {
+ return null;
+ }
+
+ /** Invoke an instance of the SEI implementation bean */
+ public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl, EndpointInvocation epInv) throws Exception
+ {
+ log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
+
+ // these are provided by the ServerLoginHandler
+ Principal principal = SecurityAssociation.getPrincipal();
+ Object credential = SecurityAssociation.getCredential();
+
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+
+ // invoke on the container
+ try
+ {
+ // setup the invocation
+ Method method = epInv.getJavaMethod();
+ Object[] args = epInv.getRequestPayload();
+ Invocation inv = new Invocation(null, method, args, null, principal, credential);
+
+ inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
+ inv.setValue(InvocationKey.SOAP_MESSAGE, msgContext.getSOAPMessage());
+ inv.setType(InvocationType.SERVICE_ENDPOINT);
+
+ // Set the handler callback and endpoint invocation
+ inv.setValue(HandlerCallback.class.getName(), new HandlerCallback(seInfo), PayloadKey.TRANSIENT);
+ inv.setValue(EndpointInvocation.class.getName(), epInv, PayloadKey.TRANSIENT);
+
+ String[] sig = { Invocation.class.getName() };
+ Object retObj = server.invoke(objectName, "invoke", new Object[] { inv }, sig);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
+ {
+ // do nothing
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ public boolean callRequestHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return handlerDelegate.callRequestHandlerChain(seInfo, type);
+ else
+ return true;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ public boolean callResponseHandlerChain(ServiceEndpointInfo seInfo, HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return handlerDelegate.callResponseHandlerChain(seInfo, type);
+ else
+ return true;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ public boolean callFaultHandlerChain(ServiceEndpointInfo seInfo, HandlerType type, Exception ex)
+ {
+ if (type == HandlerType.PRE)
+ return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
+ else
+ return true;
+ }
+
+ // The ServiceEndpointInterceptor calls the methods in this callback
+ public class HandlerCallback
+ {
+ private ServiceEndpointInfo seInfo;
+
+ public HandlerCallback(ServiceEndpointInfo seInfo)
+ {
+ this.seInfo = seInfo;
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ public boolean callRequestHandlerChain(HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return true;
+ else
+ return handlerDelegate.callRequestHandlerChain(seInfo, type);
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ public boolean callResponseHandlerChain(HandlerType type)
+ {
+ if (type == HandlerType.PRE)
+ return true;
+ else
+ return handlerDelegate.callResponseHandlerChain(seInfo, type);
+ }
+
+ /** Handlers are beeing called through the HandlerCallback from the EJB interceptor */
+ public boolean callFaultHandlerChain(HandlerType type, Exception ex)
+ {
+ if (type == HandlerType.PRE)
+ return true;
+ else
+ return handlerDelegate.callFaultHandlerChain(seInfo, type, ex);
+ }
+
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB21.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,145 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.lang.reflect.Method;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.xml.rpc.soap.SOAPFaultException;
+
+import org.jboss.aop.Dispatcher;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
+import org.jboss.ws.core.server.ServiceEndpointInfo;
+import org.jboss.ws.core.server.ServiceEndpointInvoker;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * Handles invocations on EJB3 endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 23-Jul-2005
+ */
+public class ServiceEndpointInvokerEJB3 extends AbstractServiceEndpointInvoker implements ServiceEndpointInvoker
+{
+ // provide logging
+ private Logger log = Logger.getLogger(ServiceEndpointInvokerEJB3.class);
+
+ private MBeanServer server;
+ private ObjectName objectName;
+
+ public ServiceEndpointInvokerEJB3()
+ {
+ server = MBeanServerLocator.locateJBoss();
+ }
+
+ /** Initialize the service endpoint */
+ @Override
+ public void initServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ super.initServiceEndpoint(seInfo);
+
+ String ejbName = seInfo.getServerEndpointMetaData().getLinkName();
+ UnifiedDeploymentInfo udi = seInfo.getUnifiedDeploymentInfo();
+ String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + udi.simpleName;
+ if (udi.parent != null)
+ {
+ nameStr += ",ear=" + udi.parent.simpleName;
+ }
+
+ objectName = ObjectNameFactory.create(nameStr.toString());
+ }
+
+ /** Load the SEI implementation bean if necessary
+ */
+ public Class loadServiceEndpoint(ServiceEndpointInfo seInfo)
+ {
+ if (server.isRegistered(objectName) == false)
+ throw new WSException("Cannot find service endpoint target: " + objectName);
+
+ return null;
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object endpointContext, Class seiImplClass)
+ {
+ return null;
+ }
+
+ /** Invoke an instance of the SEI implementation bean */
+ public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl, EndpointInvocation epInv) throws Exception
+ {
+ log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
+
+ /* [FIXME] how to do this for EJB3
+
+ // these are provided by the ServerLoginHandler
+ Principal principal = SecurityAssociation.getPrincipal();
+ Object credential = SecurityAssociation.getCredential();
+
+ CommonMessageContext msgContext = MessageContextAssociation.getMessageContext();
+
+ Invocation inv = new Invocation(null, method, args, null, principal, credential);
+ inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
+ inv.setValue(InvocationKey.SOAP_MESSAGE, msgContext.getMessage());
+ inv.setType(InvocationType.SERVICE_ENDPOINT);
+ */
+
+ // invoke on the container
+ try
+ {
+ // setup the invocation
+ Method seiMethod = epInv.getJavaMethod();
+ Object[] args = epInv.getRequestPayload();
+
+ Dispatcher dispatcher = Dispatcher.singleton;
+ String canonicalName = objectName.getCanonicalName();
+ StatelessContainer container = (StatelessContainer)dispatcher.getRegistered(canonicalName);
+ if (container == null)
+ throw new WSException("Cannot obtain container from Dispatcher: " + canonicalName);
+
+ Class implClass = container.getBeanClass();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object retObj = container.localInvoke(implMethod, args);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Throwable e)
+ {
+ handleInvocationException(e);
+ }
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary */
+ public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
+ {
+ // do nothing
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.lang.reflect.Method;
+
+import javax.xml.rpc.soap.SOAPFaultException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
+import org.jboss.ws.core.server.ServiceEndpointInfo;
+import org.jboss.ws.core.server.ServiceEndpointInvoker;
+import org.jboss.ws.core.utils.ThreadLocalAssociation;
+
+/**
+ * Handles invocations on MDB endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Mar-2006
+ */
+public class ServiceEndpointInvokerMDB extends AbstractServiceEndpointInvoker implements ServiceEndpointInvoker
+{
+ // provide logging
+ private Logger log = Logger.getLogger(ServiceEndpointInvokerMDB.class);
+
+ /** Load the SEI implementation bean if necessary
+ */
+ public Class loadServiceEndpoint(ServiceEndpointInfo seInfo) throws ClassNotFoundException
+ {
+ return null;
+ }
+
+ // The dispatcher sets the target bean object
+ public void setTargetBeanObject(Object targetMDB)
+ {
+ ThreadLocalAssociation.localInvokerMDBAssoc().set(targetMDB);
+ }
+
+ /** Create an instance of the SEI implementation bean if necessary
+ */
+ public Object createServiceEndpoint(ServiceEndpointInfo seInfo, Object endpointContext, Class seiImplClass) throws InstantiationException, IllegalAccessException
+ {
+ return ThreadLocalAssociation.localInvokerMDBAssoc().get();
+ }
+
+ /** Invoke an instance of the SEI implementation bean */
+ public void invokeServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl, EndpointInvocation epInv) throws Exception
+ {
+ log.debug("invokeServiceEndpoint: " + epInv.getJavaMethod().getName());
+ try
+ {
+ Class implClass = seiImpl.getClass();
+ Method seiMethod = epInv.getJavaMethod();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object[] args = epInv.getRequestPayload();
+ Object retObj = implMethod.invoke(seiImpl, args);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ finally
+ {
+ // cleanup thread local
+ setTargetBeanObject(null);
+ }
+ }
+
+ /** Destroy an instance of the SEI implementation bean if necessary */
+ public void destroyServiceEndpoint(ServiceEndpointInfo seInfo, Object seiImpl)
+ {
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointInvokerMDB.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointPublisher.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointPublisher.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointPublisher.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * Publish the HTTP service endpoint to Tomcat
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class ServiceEndpointPublisher extends AbstractServiceEndpointPublisher
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(ServiceEndpointPublisher.class);
+
+ public String publishServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
+ {
+ URL warURL = udi.localUrl;
+ DeploymentInfo di = (DeploymentInfo)udi.context.get(DeploymentInfo.class.getName());
+ if (di == null)
+ throw new IllegalStateException("Cannot obtain DeploymentInfo from context");
+
+ rewriteWarWebXml(warURL);
+
+ // Preserve the repository config
+ DeploymentInfo auxdi = new DeploymentInfo(warURL, null, MBeanServerLocator.locateJBoss());
+ auxdi.repositoryConfig = di.getTopRepositoryConfig();
+ getMainDeployer().deploy(auxdi);
+ return "OK";
+ }
+
+ public String destroyServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
+ {
+ getMainDeployer().undeploy(udi.localUrl);
+ return "OK";
+ }
+
+ public Set<String> getWebServiceServletLinks(UnifiedDeploymentInfo udi)
+ {
+ Set<String> links = new HashSet<String>();
+
+ UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
+
+ for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ {
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ {
+ ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
+ links.add(sepMetaData.getLinkName());
+
+ }
+ }
+
+ return links;
+ }
+
+ private MainDeployerMBean getMainDeployer() throws MBeanProxyCreationException
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ MainDeployerMBean mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server);
+ return mainDeployer;
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointPublisher.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.webservice.metadata.serviceref.HandlerMetaData;
+import org.jboss.webservice.metadata.serviceref.InitParamMetaData;
+import org.jboss.webservice.metadata.serviceref.PortComponentRefMetaData;
+import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
+
+/**
+ * Build container independent service ref meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class ServiceRefMetaDataAdaptor
+{
+ public static UnifiedServiceRefMetaData buildUnifiedServiceRefMetaData(ServiceRefMetaData srmd)
+ {
+ UnifiedServiceRefMetaData usrmd = new UnifiedServiceRefMetaData();
+ usrmd.setServiceRefName(srmd.getServiceRefName());
+ usrmd.setServiceInterface(srmd.getServiceInterface());
+ usrmd.setWsdlLocation(srmd.getWsdlURL());
+ usrmd.setMappingLocation(srmd.getJavaWsdlMappingURL());
+ usrmd.setServiceQName(srmd.getServiceQName());
+
+ LinkedHashMap<String, UnifiedPortComponentRefMetaData> pcrefs = new LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
+ for (PortComponentRefMetaData pcmd : srmd.getPortComponentRefs())
+ {
+ UnifiedPortComponentRefMetaData upcmd = new UnifiedPortComponentRefMetaData();
+ upcmd.setServiceEndpointInterface(pcmd.getServiceEndpointInterface());
+ upcmd.setPortComponentLink(pcmd.getPortComponentLink());
+ upcmd.setCallProperties(pcmd.getCallProperties());
+ pcrefs.put(pcmd.getServiceEndpointInterface(), upcmd);
+ }
+ usrmd.setPortComponentRefs(pcrefs);
+
+ ArrayList<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>();
+ for (HandlerMetaData hmd : srmd.getHandlers())
+ {
+ UnifiedHandlerMetaData uhmd = new UnifiedHandlerMetaData(null);
+ uhmd.setHandlerName(hmd.getHandlerName());
+ uhmd.setHandlerClass(hmd.getHandlerClass());
+
+ for(String portname : hmd.getPortNames())
+ {
+ uhmd.addPortName(portname);
+ }
+ for (InitParamMetaData ipmd : hmd.getInitParams())
+ {
+ HandlerInitParam ip = new HandlerInitParam();
+ ip.setParamName(ipmd.getParamName());
+ ip.setParamValue(ipmd.getParamValue());
+ uhmd.addInitParam(ip);
+ }
+ for (QName soapHeader : hmd.getSoapHeaders())
+ {
+ uhmd.addSoapHeader(soapHeader);
+ }
+ for (String soapRole : hmd.getSoapRoles())
+ {
+ uhmd.addSoapRole(soapRole);
+ }
+ handlers.add(uhmd);
+ }
+ usrmd.setHandlers(handlers);
+
+ usrmd.setConfigName(srmd.getConfigName());
+ usrmd.setConfigFile(srmd.getConfigFile());
+ usrmd.setWsdlOverride(srmd.getWsdlOverride());
+ usrmd.setCallProperties(srmd.getCallProperties());
+
+ return usrmd;
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.metadata.WebMetaData;
+import org.jboss.metadata.WebSecurityMetaData;
+import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
+import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData.PublishLocationAdapter;
+import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
+
+/**
+ * Build container independent web meta data
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class WebMetaDataAdaptor
+{
+ public static UnifiedWebMetaData buildUnifiedWebMetaData(WebMetaData wmd)
+ {
+ UnifiedWebMetaData umd = new UnifiedWebMetaData();
+ umd.setContextRoot(wmd.getContextRoot());
+ umd.setServletMappings(wmd.getServletMappings());
+ umd.setServletClassMap(wmd.getServletClassMap());
+ umd.setConfigName(wmd.getConfigName());
+ umd.setConfigFile(wmd.getConfigFile());
+ umd.setContextLoader(wmd.getContextLoader());
+ umd.setSecurityDomain(wmd.getSecurityDomain());
+ umd.setPublishLocationAdapter(getPublishLocationAdpater(wmd));
+ umd.setSecurityMetaData(getSecurityMetaData(wmd.getSecurityContraints()));
+
+ return umd;
+ }
+
+ private static PublishLocationAdapter getPublishLocationAdpater(final WebMetaData wmd)
+ {
+ return new PublishLocationAdapter ()
+ {
+ public String getWsdlPublishLocationByName(String name)
+ {
+ return wmd.getWsdlPublishLocationByName(name);
+ }
+ };
+ }
+
+ private static List<UnifiedWebSecurityMetaData> getSecurityMetaData(final Iterator securityConstraints)
+ {
+ ArrayList<UnifiedWebSecurityMetaData> unifiedsecurityMetaData = new ArrayList<UnifiedWebSecurityMetaData>();
+
+ while (securityConstraints.hasNext())
+ {
+ WebSecurityMetaData securityMetaData = (WebSecurityMetaData)securityConstraints.next();
+
+ UnifiedWebSecurityMetaData current = new UnifiedWebSecurityMetaData();
+ unifiedsecurityMetaData.add(current);
+
+ current.setTransportGuarantee(securityMetaData.getTransportGuarantee());
+
+ HashMap resources = securityMetaData.getWebResources();
+ for (Object webResourceObj : resources.values())
+ {
+ WebResourceCollection webResource = (WebResourceCollection)webResourceObj;
+ UnifiedWebResourceCollection currentResource = current.addWebResource(webResource.getName());
+ for (String currentPattern : webResource.getUrlPatterns())
+ {
+ currentResource.addPattern(currentPattern);
+ }
+ }
+
+ }
+
+ return unifiedsecurityMetaData;
+ }
+
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,139 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.naming.Context;
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.xml.rpc.JAXRPCException;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.naming.Util;
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxrpc.ServiceReferenceable;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientDeployment;
+import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.tools.wsdl.WSDL11DefinitionFactory;
+
+/**
+ * Binds a JAXRPC Service object in the client's ENC for every service-ref element in the
+ * deployment descriptor.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Jan-2005
+ */
+public class WebServiceClientDeployer extends ServiceMBeanSupport implements WebServiceClientDeployerMBean
+{
+ /**
+ * This binds a jaxrpc Service into the callers ENC for every service-ref element
+ *
+ * @param envCtx ENC to bind the javax.rpc.xml.Service object to
+ * @param serviceRefs An iterator of the service-ref elements in the client deployment descriptor
+ * @param di The client's deployment info
+ * @throws org.jboss.deployment.DeploymentException if it goes wrong
+ */
+ public void setupServiceRefEnvironment(Context envCtx, Iterator serviceRefs, DeploymentInfo di) throws DeploymentException
+ {
+ try
+ {
+ while (serviceRefs.hasNext())
+ {
+ ServiceRefMetaData serviceRef = (ServiceRefMetaData)serviceRefs.next();
+ String serviceRefName = serviceRef.getServiceRefName();
+
+ UnifiedServiceRefMetaData wsServiceRef = ServiceRefMetaDataAdaptor.buildUnifiedServiceRefMetaData(serviceRef);
+
+ JavaWsdlMapping javaWsdlMapping = getJavaWsdlMapping(wsServiceRef);
+ wsServiceRef.setJavaWsdlMapping(javaWsdlMapping);
+
+ Definition wsdlDefinition = getWsdlDefinition(wsServiceRef);
+ wsServiceRef.setWsdlDefinition(wsdlDefinition);
+
+ // build the container independent deployment info
+ UnifiedDeploymentInfo udi = new JAXRPCClientDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_Client);
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, di);
+
+ ServiceReferenceable ref = new ServiceReferenceable(wsServiceRef, udi);
+ Util.bind(envCtx, serviceRefName, ref);
+
+ log.debug("Webservice binding: java:comp/env/" + serviceRefName);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Cannot bind webservice to client environment", e);
+ }
+ }
+
+ private JavaWsdlMapping getJavaWsdlMapping(UnifiedServiceRefMetaData serviceRef)
+ {
+ JavaWsdlMapping javaWsdlMapping = null;
+ URL mappingURL = serviceRef.getMappingLocation();
+ if (mappingURL != null)
+ {
+ try
+ {
+ // setup the XML binding Unmarshaller
+ JavaWsdlMappingFactory mappingFactory = JavaWsdlMappingFactory.newInstance();
+ javaWsdlMapping = mappingFactory.parse(mappingURL);
+ }
+ catch (Exception e)
+ {
+ throw new JAXRPCException("Cannot unmarshal jaxrpc-mapping-file: " + mappingURL, e);
+ }
+ }
+ return javaWsdlMapping;
+ }
+
+ private Definition getWsdlDefinition(UnifiedServiceRefMetaData serviceRef)
+ {
+ Definition wsdlDefinition = null;
+ {
+ URL wsdlOverride = serviceRef.getWsdlOverride();
+ URL wsdlURL = serviceRef.getWsdlLocation();
+ if (wsdlOverride == null && wsdlURL != null)
+ {
+ try
+ {
+ WSDL11DefinitionFactory factory = WSDL11DefinitionFactory.newInstance();
+ wsdlDefinition = factory.parse(wsdlURL);
+ }
+ catch (WSDLException e)
+ {
+ throw new WSException("Cannot unmarshall wsdl, cause: " + e.toString());
+ }
+ }
+ }
+ return wsdlDefinition;
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.integration.jboss42;
+
+import javax.management.ObjectName;
+
+import org.jboss.ws.core.utils.ObjectNameFactory;
+import org.jboss.system.ServiceMBean;
+import org.jboss.webservice.WebServiceClientDeployment;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface WebServiceClientDeployerMBean extends WebServiceClientDeployment, ServiceMBean
+{
+ // default object name
+ public static final ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=WebServiceClientDeployer");
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42.jms;
+
+// $Id:JMSMessageDispatcher.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.rmi.RemoteException;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.server.ServiceEndpoint;
+import org.jboss.ws.core.server.ServiceEndpointInvoker;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.integration.jboss42.ServiceEndpointInvokerMDB;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+
+/**
+ * A dispatcher for SOAPMessages
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class JMSMessageDispatcher implements JMSMessageDispatcherMBean
+{
+ // logging support
+ protected Logger log = Logger.getLogger(JMSMessageDispatcher.class);
+
+ /** Dispatch the message to the underlying SOAP engine
+ */
+ public SOAPMessage dipatchMessage(String fromName, Object targetBean, InputStream reqMessage) throws RemoteException
+ {
+ ServiceEndpointManagerFactory factory = ServiceEndpointManagerFactory.getInstance();
+ ServiceEndpointManager epManager = factory.getServiceEndpointManager();
+ ObjectName sepID = getServiceEndpointForDestination(epManager, fromName);
+
+ if (sepID == null)
+ throw new WSException("Cannot find serviceID for: " + fromName);
+
+ log.debug("dipatchMessage: " + sepID);
+
+ // Setup the MDB invoker
+ ServiceEndpoint sep = epManager.getServiceEndpointByID(sepID);
+ ServerEndpointMetaData sepMetaData = sep.getServiceEndpointInfo().getServerEndpointMetaData();
+
+ ServiceEndpointInvoker invoker = sep.getServiceEndpointInfo().getInvoker();
+ if (invoker instanceof ServiceEndpointInvokerMDB)
+ {
+ ServiceEndpointInvokerMDB mdbInvoker = (ServiceEndpointInvokerMDB)invoker;
+ mdbInvoker.setTargetBeanObject(targetBean);
+ }
+
+ // Associate a message context with the current thread
+ CommonMessageContext msgContext = new SOAPMessageContextJAXRPC();
+ MessageContextAssociation.pushMessageContext(msgContext);
+ msgContext.setEndpointMetaData(sepMetaData);
+
+ SOAPMessage resMessage = null;
+ try
+ {
+ // Process the request message and return the already serialized response
+ // Legacy implementations of the JMSTransportSupport dont provide a msg
+ // context which is needed for serialization.
+ resMessage = sep.handleRequest(null, null, reqMessage);
+ resMessage.writeTo(new ByteArrayOutputStream());
+ return resMessage;
+ }
+ catch (Exception ex)
+ {
+ WSException.rethrow("Cannot process SOAP request", ex);
+ }
+ finally
+ {
+ MessageContextAssociation.popMessageContext();
+ }
+
+ return resMessage;
+ }
+
+ /** Dispatch the message to the underlying SOAP engine
+ */
+ public SOAPMessage delegateMessage(String serviceID, InputStream soapMessage) throws RemoteException
+ {
+ throw new NotImplementedException();
+ }
+
+ // The destination jndiName is encoded in the service object name under key 'jms'
+ private ObjectName getServiceEndpointForDestination(ServiceEndpointManager epManager, String fromName)
+ {
+ ObjectName sepID = null;
+ for (ObjectName aux : epManager.getServiceEndpoints())
+ {
+ String jmsProp = aux.getKeyProperty("jms");
+ if (jmsProp != null && jmsProp.equals(fromName))
+ {
+ sepID = aux;
+ break;
+ }
+ }
+ return sepID;
+ }
+
+ public void create() throws Exception
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ if (server != null)
+ {
+ server.registerMBean(this, OBJECT_NAME);
+ }
+ }
+
+ public void destroy() throws Exception
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ if (server != null)
+ {
+ server.unregisterMBean(OBJECT_NAME);
+ }
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcher.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcherMBean.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcherMBean.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcherMBean.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42.jms;
+
+// $Id:JMSMessageDispatcher.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
+
+public interface JMSMessageDispatcherMBean extends MessageDispatcher
+{
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSMessageDispatcherMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSTransportSupport.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSTransportSupport.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSTransportSupport.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,241 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42.jms;
+
+// $Id:JMSTransportSupport.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBException;
+import javax.ejb.MessageDrivenBean;
+import javax.ejb.MessageDrivenContext;
+import javax.jms.BytesMessage;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.NestedRuntimeException;
+
+/**
+ * The abstract base class for MDBs that want to act as web service endpoints.
+ * A subclass should only need to implement the service endpoint interface.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public abstract class JMSTransportSupport implements MessageDrivenBean, MessageListener
+{
+ // logging support
+ protected Logger log = Logger.getLogger(JMSTransportSupport.class);
+
+ //private MessageDrivenContext mdbCtx;
+ private QueueConnectionFactory queueFactory;
+
+ /**
+ * All messages come in here, if it is a BytesMessage we pass it on for further processing.
+ */
+ public void onMessage(Message message)
+ {
+ try
+ {
+ String msgStr = null;
+ if (message instanceof BytesMessage)
+ {
+ msgStr = getMessageStr((BytesMessage)message);
+ }
+ else if (message instanceof TextMessage)
+ {
+ msgStr = ((TextMessage)message).getText();
+ }
+ else
+ {
+ log.warn("Invalid message type: " + message);
+ return;
+ }
+
+ log.debug("Incomming SOAP message: " + msgStr);
+
+ String fromName = null;
+ Destination destination = message.getJMSDestination();
+ if (destination instanceof Queue)
+ fromName = "queue/" + ((Queue)destination).getQueueName();
+ if (destination instanceof Topic)
+ fromName = "topic/" + ((Topic)destination).getTopicName();
+
+ InputStream reqMessage = new ByteArrayInputStream(msgStr.getBytes());
+ SOAPMessage resMessage = processSOAPMessage(fromName, reqMessage);
+
+ if (resMessage != null)
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ resMessage.writeTo(baos);
+
+ msgStr = new String(baos.toByteArray());
+ log.debug("Outgoing SOAP message: " + msgStr);
+
+ Queue replyQueue = getReplyQueue(message);
+ if (replyQueue != null)
+ {
+ sendResponse(replyQueue, msgStr);
+ }
+ else
+ {
+ log.warn("No reply queue, ignore response message");
+ }
+ }
+ else
+ {
+ log.debug("SOAP response message is null");
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new EJBException(e);
+ }
+ }
+
+ protected SOAPMessage processSOAPMessage(String fromName, InputStream reqMessage) throws SOAPException, IOException, RemoteException
+ {
+ MessageDispatcher msgDispatcher = new JMSMessageDispatcher();
+ SOAPMessage resMessage = msgDispatcher.dipatchMessage(fromName, this, reqMessage);
+ return resMessage;
+ }
+
+ private String getMessageStr(BytesMessage message) throws Exception
+ {
+ byte[] buffer = new byte[8 * 1024];
+ ByteArrayOutputStream out = new ByteArrayOutputStream(buffer.length);
+ int read = message.readBytes(buffer);
+ while (read != -1)
+ {
+ out.write(buffer, 0, read);
+ read = message.readBytes(buffer);
+ }
+
+ byte[] msgBytes = out.toByteArray();
+ return new String(msgBytes);
+ }
+
+ /**
+ * Get the reply queue.
+ */
+ protected Queue getReplyQueue(Message message) throws JMSException
+ {
+ Queue replyQueue = (Queue)message.getJMSReplyTo();
+ return replyQueue;
+ }
+
+ /**
+ * Respond to the call by sending a message to the reply queue
+ */
+ protected void sendResponse(Queue replyQueue, String msgStr) throws SOAPException, IOException, JMSException
+ {
+ QueueConnection qc = queueFactory.createQueueConnection();
+ QueueSession session = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+ QueueSender sender = null;
+ try
+ {
+ sender = session.createSender(replyQueue);
+ TextMessage responseMessage = session.createTextMessage(msgStr);
+ sender.send(responseMessage);
+ log.info("Sent response");
+ }
+ finally
+ {
+ try
+ {
+ sender.close();
+ }
+ catch (JMSException ignored)
+ {
+ }
+ try
+ {
+ session.close();
+ }
+ catch (JMSException ignored)
+ {
+ }
+ try
+ {
+ qc.close();
+ }
+ catch (JMSException ignored)
+ {
+ }
+ }
+ }
+
+ // MDB lifecycle methods ********************************************************************************************
+
+ public void ejbCreate()
+ {
+ try
+ {
+ InitialContext ctx = new InitialContext();
+ queueFactory = (QueueConnectionFactory)ctx.lookup("java:/ConnectionFactory");
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new NestedRuntimeException(e);
+ }
+ }
+
+ /**
+ * A container invokes this method before it ends the life of the message-driven object.
+ */
+ public void ejbRemove() throws EJBException
+ {
+ }
+
+ /**
+ * Set the associated message-driven context.
+ */
+ public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException
+ {
+ //this.mdbCtx = ctx;
+ }
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/JMSTransportSupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/MessageDispatcher.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/MessageDispatcher.java 2006-12-20 13:22:21 UTC (rev 1673)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/MessageDispatcher.java 2006-12-20 19:36:24 UTC (rev 1674)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42.jms;
+
+// $Id:MessageDispatcher.java 898 2006-09-05 08:23:03Z thomas.diesler(a)jboss.com $
+
+import java.io.InputStream;
+import java.rmi.RemoteException;
+
+import javax.management.ObjectName;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * A dispatcher for SOAPMessages
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-Feb-2006
+ */
+public interface MessageDispatcher
+{
+ public static final ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=JMSTransportSupport");
+
+ /** Dispatch the message to the underlying SOAP engine
+ */
+ SOAPMessage dipatchMessage(String fromName, Object targetImplBean, InputStream reqMessage) throws RemoteException;
+
+ /** Dispatch the message to the underlying SOAP engine
+ */
+ SOAPMessage delegateMessage(String serviceID, InputStream reqMessage) throws RemoteException;
+}
\ No newline at end of file
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss42/jms/MessageDispatcher.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
19 years
JBossWS SVN: r1673 - branches/tdiesler
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-20 08:22:21 -0500 (Wed, 20 Dec 2006)
New Revision: 1673
Added:
branches/tdiesler/trunk/
Log:
recreate userbranch
Copied: branches/tdiesler/trunk (from rev 1671, trunk)
19 years
JBossWS SVN: r1672 - branches/tdiesler
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-20 08:21:39 -0500 (Wed, 20 Dec 2006)
New Revision: 1672
Removed:
branches/tdiesler/trunk/
Log:
recreate userbranch
19 years