[jbossws-commits] JBossWS SVN: r3145 - in trunk: integration/jboss42/ant-import and 20 other directories.
jbossws-commits at lists.jboss.org
jbossws-commits at lists.jboss.org
Fri May 18 17:40:58 EDT 2007
Author: thomas.diesler at jboss.com
Date: 2007-05-18 17:40:57 -0400 (Fri, 18 May 2007)
New Revision: 3145
Added:
trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/BasicInvocationHandler.java
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/DeploymentDescriptorParserExt.java
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/DeploymentDescriptorParserJBWS.java
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/EndpointAssociation.java
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/InvokerEJB3.java
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/InvokerJSE.java
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSEndpointServletJBWS.java
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListenerExt.java
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListenerJBWS.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceLifecycleInvocationHandler.java
Removed:
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSEndpointServlet.java
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListener.java
Modified:
trunk/build/ant-import/build-samples.xml
trunk/integration/jboss42/ant-import/build-thirdparty.xml
trunk/integration/jboss42/src/main/java/org/jboss/wsintegration/container/jboss42/InvocationHandlerEJB21.java
trunk/integration/jboss42/src/main/java/org/jboss/wsintegration/container/jboss42/InvocationHandlerEJB3.java
trunk/integration/jboss50/ant-import/build-thirdparty.xml
trunk/integration/jboss50/src/main/java/org/jboss/wsintegration/container/jboss50/InvocationHandlerEJB21.java
trunk/integration/jboss50/src/main/java/org/jboss/wsintegration/container/jboss50/InvocationHandlerEJB3.java
trunk/integration/jbws/ant-import/build-deploy.xml
trunk/integration/jbws/ant-import/build-testsuite.xml
trunk/integration/jbws/build.xml
trunk/integration/jbws/src/main/resources/jbossws-jbws42.sar/jbossws.beans/META-INF/jboss-beans.xml
trunk/integration/jbws/src/main/resources/jbossws-jbws50.sar/META-INF/jbossws-beans.xml
trunk/integration/spi/ant-import/build-release.xml
trunk/integration/spi/build.xml
trunk/integration/spi/src/main/etc/component-info.xml
trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/AbstractInvocationHandler.java
trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/BasicEndpointInvocation.java
trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/InvocationHandler.java
trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/InvocationHandlerJSE.java
trunk/integration/sunri/ant-import/build-deploy.xml
trunk/integration/sunri/ant-import/build-testsuite.xml
trunk/integration/sunri/ant-import/build-thirdparty.xml
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/EndpointNameDeployer.java
trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/ModifyWebMetaDataDeployer.java
trunk/integration/sunri/src/main/resources/jbossws-jboss50.sar/META-INF/jbossws-beans.xml
trunk/jbossws-core/ant-import-tests/build-testsuite.xml
trunk/jbossws-core/ant-import/build-thirdparty.xml
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
trunk/testsuite/ant-import/build-jars-jaxws.xml
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
Log:
Add support for InvocationHandler with SunRI
Modified: trunk/build/ant-import/build-samples.xml
===================================================================
--- trunk/build/ant-import/build-samples.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/build/ant-import/build-samples.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -67,7 +67,7 @@
<mkdir dir="${build.src.samples.dir}/lib"/>
<copy todir="${build.src.samples.dir}/lib">
<fileset dir="${core.output.lib.dir}">
- <include name="jbossws-integration.jar"/>
+ <include name="jbossws-spi.jar"/>
<include name="jbossws-client.jar"/>
<include name="jbossws-core.jar"/>
<include name="jboss-jaxrpc.jar"/>
Modified: trunk/integration/jboss42/ant-import/build-thirdparty.xml
===================================================================
--- trunk/integration/jboss42/ant-import/build-thirdparty.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/jboss42/ant-import/build-thirdparty.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -32,7 +32,7 @@
<!-- The compile classpath for jboss42 integration -->
<path id="jbws42.integration.classpath">
- <pathelement location="${spi.dir}/output/lib/jbossws-integration.jar"/>
+ <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
<pathelement location="${spi.dir}/thirdparty/jaxws-api.jar"/>
<pathelement location="${spi.dir}/thirdparty/jaxrpc-api.jar"/>
<pathelement location="${spi.dir}/thirdparty/jsr181-api.jar"/>
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsintegration/container/jboss42/InvocationHandlerEJB21.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsintegration/container/jboss42/InvocationHandlerEJB21.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsintegration/container/jboss42/InvocationHandlerEJB21.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -123,7 +123,7 @@
}
- public void invoke(Endpoint ep, EndpointInvocation epInv) throws Exception
+ public void invoke(Endpoint ep, Object beanInstance, EndpointInvocation epInv) throws Exception
{
log.debug("Invoke: " + epInv.getJavaMethod().getName());
Modified: trunk/integration/jboss42/src/main/java/org/jboss/wsintegration/container/jboss42/InvocationHandlerEJB3.java
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsintegration/container/jboss42/InvocationHandlerEJB3.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsintegration/container/jboss42/InvocationHandlerEJB3.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -81,7 +81,7 @@
throw new WebServiceException("Cannot find service endpoint target: " + objectName);
}
- public void invoke(Endpoint ep, EndpointInvocation epInv) throws Exception
+ public void invoke(Endpoint ep, Object beanInstance, EndpointInvocation epInv) throws Exception
{
try
{
Modified: trunk/integration/jboss50/ant-import/build-thirdparty.xml
===================================================================
--- trunk/integration/jboss50/ant-import/build-thirdparty.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/jboss50/ant-import/build-thirdparty.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -32,7 +32,7 @@
<!-- The compile classpath for jboss50 integration -->
<path id="jbws50.integration.classpath">
- <pathelement location="${spi.dir}/output/lib/jbossws-integration.jar"/>
+ <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
<pathelement location="${spi.dir}/thirdparty/jaxws-api.jar"/>
<pathelement location="${spi.dir}/thirdparty/jaxrpc-api.jar"/>
<pathelement location="${spi.dir}/thirdparty/jsr181-api.jar"/>
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsintegration/container/jboss50/InvocationHandlerEJB21.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsintegration/container/jboss50/InvocationHandlerEJB21.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsintegration/container/jboss50/InvocationHandlerEJB21.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -123,7 +123,7 @@
}
- public void invoke(Endpoint ep, EndpointInvocation epInv) throws Exception
+ public void invoke(Endpoint ep, Object beanInstance, EndpointInvocation epInv) throws Exception
{
log.debug("Invoke: " + epInv.getJavaMethod().getName());
Modified: trunk/integration/jboss50/src/main/java/org/jboss/wsintegration/container/jboss50/InvocationHandlerEJB3.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsintegration/container/jboss50/InvocationHandlerEJB3.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsintegration/container/jboss50/InvocationHandlerEJB3.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -81,7 +81,7 @@
throw new WebServiceException("Cannot find service endpoint target: " + objectName);
}
- public void invoke(Endpoint ep, EndpointInvocation epInv) throws Exception
+ public void invoke(Endpoint ep, Object beanInstance, EndpointInvocation epInv) throws Exception
{
try
{
Modified: trunk/integration/jbws/ant-import/build-deploy.xml
===================================================================
--- trunk/integration/jbws/ant-import/build-deploy.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/jbws/ant-import/build-deploy.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -43,7 +43,7 @@
</copy>
<copy todir="${jboss50.home}/server/${jboss.server.instance}/lib" overwrite="true">
<fileset dir="${spi.dir}/output/lib">
- <include name="jbossws-integration.jar"/>
+ <include name="jbossws-spi.jar"/>
</fileset>
<fileset dir="${core.dir}/output/lib">
<include name="jboss-jaxrpc.jar"/>
@@ -107,7 +107,7 @@
</copy>
<copy todir="${jboss42.home}/lib" overwrite="true">
<fileset dir="${spi.dir}/output/lib">
- <include name="jbossws-integration.jar"/>
+ <include name="jbossws-spi.jar"/>
</fileset>
</copy>
<copy todir="${jboss42.home}/server/${jboss.server.instance}/lib" overwrite="true">
@@ -136,8 +136,8 @@
<include name="jbossws-wsconsume-impl.jar"/>
</fileset>
<fileset dir="${jboss42.home}/lib">
- <include name="jbossws-integration.jar"/> <!-- The old integration jar-->
- <include name="jbossws-integration.jar"/>
+ <include name="jbossws-spi.jar"/> <!-- The old integration jar-->
+ <include name="jbossws-spi.jar"/>
</fileset>
<fileset dir="${jboss42.home}/server/${jboss.server.instance}/lib">
<include name="jboss-jaxrpc.jar"/>
Modified: trunk/integration/jbws/ant-import/build-testsuite.xml
===================================================================
--- trunk/integration/jbws/ant-import/build-testsuite.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/jbws/ant-import/build-testsuite.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -39,7 +39,7 @@
<target name="tests-init" depends="tests-prepare">
<path id="jbossws.classpath">
- <pathelement location="${spi.dir}/output/lib/jbossws-integration.jar"/>
+ <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
<pathelement location="${core.dir}/output/lib/jboss-jaxrpc.jar"/>
<pathelement location="${core.dir}/output/lib/jboss-jaxws.jar"/>
<pathelement location="${core.dir}/output/lib/jboss-saaj.jar"/>
Modified: trunk/integration/jbws/build.xml
===================================================================
--- trunk/integration/jbws/build.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/jbws/build.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -161,7 +161,7 @@
<include name="jbossws-context.war"/>
</fileset>
<fileset dir="${spi.dir}/output/lib">
- <include name="jbossws-integration.jar"/>
+ <include name="jbossws-spi.jar"/>
</fileset>
<fileset dir="${core.dir}/output/lib">
<include name="jboss-jaxws.jar"/>
Modified: trunk/integration/jbws/src/main/resources/jbossws-jbws42.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- trunk/integration/jbws/src/main/resources/jbossws-jbws42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/jbws/src/main/resources/jbossws-jbws42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -124,9 +124,9 @@
<property name="lifecycleHandler">org.jboss.ws.core.server.LifecycleHandlerImpl</property>
<property name="invocationHandler">
<map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry><key>JAXRPC_JSE</key><value>org.jboss.wsintegration.spi.invocation.InvocationHandlerJSE</value></entry>
+ <entry><key>JAXRPC_JSE</key><value>org.jboss.ws.core.jaxrpc.ServiceLifecycleInvocationHandler</value></entry>
<entry><key>JAXRPC_EJB21</key><value>org.jboss.wsintegration.container.jboss42.InvocationHandlerEJB21</value></entry>
- <entry><key>JAXWS_JSE</key><value>org.jboss.wsintegration.spi.invocation.InvocationHandlerJSE</value></entry>
+ <entry><key>JAXWS_JSE</key><value>org.jboss.ws.core.jaxrpc.ServiceLifecycleInvocationHandler</value></entry>
<entry><key>JAXWS_EJB3</key><value>org.jboss.wsintegration.container.jboss42.InvocationHandlerEJB3</value></entry>
</map>
</property>
Modified: trunk/integration/jbws/src/main/resources/jbossws-jbws50.sar/META-INF/jbossws-beans.xml
===================================================================
--- trunk/integration/jbws/src/main/resources/jbossws-jbws50.sar/META-INF/jbossws-beans.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/jbws/src/main/resources/jbossws-jbws50.sar/META-INF/jbossws-beans.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -136,9 +136,9 @@
<property name="lifecycleHandler">org.jboss.ws.core.server.LifecycleHandlerImpl</property>
<property name="invocationHandler">
<map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry><key>JAXRPC_JSE</key><value>org.jboss.wsintegration.spi.invocation.InvocationHandlerJSE</value></entry>
+ <entry><key>JAXRPC_JSE</key><value>org.jboss.ws.core.jaxrpc.ServiceLifecycleInvocationHandler</value></entry>
<entry><key>JAXRPC_EJB21</key><value>org.jboss.wsintegration.container.jboss50.InvocationHandlerEJB21</value></entry>
- <entry><key>JAXWS_JSE</key><value>org.jboss.wsintegration.spi.invocation.InvocationHandlerJSE</value></entry>
+ <entry><key>JAXWS_JSE</key><value>org.jboss.ws.core.jaxrpc.ServiceLifecycleInvocationHandler</value></entry>
<entry><key>JAXWS_EJB3</key><value>org.jboss.wsintegration.container.jboss50.InvocationHandlerEJB3</value></entry>
</map>
</property>
Modified: trunk/integration/spi/ant-import/build-release.xml
===================================================================
--- trunk/integration/spi/ant-import/build-release.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/spi/ant-import/build-release.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -22,7 +22,7 @@
<mkdir dir="${jboss.repository.dir}/jbossws/${repository.id}/lib"/>
<copy todir="${jboss.repository.dir}/jbossws-spi/${repository.id}/lib" overwrite="true">
<fileset dir="${spi.output.lib.dir}">
- <include name="jbossws-integration.jar"/>
+ <include name="jbossws-spi.jar"/>
<include name="jbossws-integration-src.zip"/>
</fileset>
</copy>
Modified: trunk/integration/spi/build.xml
===================================================================
--- trunk/integration/spi/build.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/spi/build.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -102,9 +102,9 @@
-->
<target name="module-jars">
- <!-- Build jbossws-integration.jar -->
+ <!-- Build jbossws-spi.jar -->
<mkdir dir="${spi.output.lib.dir}"/>
- <jar jarfile="${spi.output.lib.dir}/jbossws-integration.jar" manifest="${spi.output.etc.dir}/default.mf">
+ <jar jarfile="${spi.output.lib.dir}/jbossws-spi.jar" manifest="${spi.output.etc.dir}/default.mf">
<fileset dir="${spi.output.classes.dir}">
<include name="org/jboss/wsintegration/spi/**"/>
<include name="org/jboss/ws/integration/**"/>
@@ -112,7 +112,7 @@
</jar>
<!-- Build jbossws-src.zip -->
- <zip zipfile="${spi.output.lib.dir}/jbossws-integration-src.zip" >
+ <zip zipfile="${spi.output.lib.dir}/jbossws-spi-src.zip" >
<fileset dir="${spi.java.dir}"/>
</zip>
Modified: trunk/integration/spi/src/main/etc/component-info.xml
===================================================================
--- trunk/integration/spi/src/main/etc/component-info.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/spi/src/main/etc/component-info.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -5,10 +5,10 @@
version="@repository.id@"
licenseType="lgpl">
- <artifact id="jbossws-integration.jar"/>
+ <artifact id="jbossws-spi.jar"/>
<export>
- <include input="jbossws-integration.jar"/>
+ <include input="jbossws-spi.jar"/>
</export>
</component>
Modified: trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/AbstractInvocationHandler.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/AbstractInvocationHandler.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/AbstractInvocationHandler.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -39,7 +39,7 @@
* @author Thomas.Diesler at jboss.org
* @since 25-Apr-2007
*/
-public abstract class AbstractInvocationHandler implements InvocationHandler
+public abstract class AbstractInvocationHandler extends BasicInvocationHandler
{
// provide logging
private static final Logger log = Logger.getLogger(AbstractInvocationHandler.class);
Modified: trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/BasicEndpointInvocation.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/BasicEndpointInvocation.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/BasicEndpointInvocation.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -37,6 +37,11 @@
private Method javaMethod;
private Object[] args;
private Object returnValue;
+
+ public BasicEndpointInvocation()
+ {
+ this.invocationContext = new BasicInvocationContext();
+ }
public InvocationContext getInvocationContext()
{
Added: trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/BasicInvocationHandler.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/BasicInvocationHandler.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/BasicInvocationHandler.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -0,0 +1,56 @@
+/*
+ * 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.wsintegration.spi.invocation;
+
+//$Id$
+
+import org.jboss.wsintegration.spi.deployment.Endpoint;
+
+/**
+ * A basic endpoint invocation handler.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 20-Apr-2007
+ */
+public abstract class BasicInvocationHandler implements InvocationHandler
+{
+ public EndpointInvocation createInvocation()
+ {
+ return new BasicEndpointInvocation();
+ }
+
+ public void create(Endpoint ep)
+ {
+ }
+
+ public void start(Endpoint ep)
+ {
+ }
+
+ public void stop(Endpoint ep)
+ {
+ }
+
+ public void destroy(Endpoint ep)
+ {
+ }
+}
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/BasicInvocationHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/InvocationHandler.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/InvocationHandler.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/InvocationHandler.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -26,13 +26,16 @@
import org.jboss.wsintegration.spi.deployment.Endpoint;
/**
- * A general ep invoker.
+ * A general endpoint invocation handler.
*
* @author Thomas.Diesler at jboss.com
* @since 20-Apr-2007
*/
public interface InvocationHandler
{
+ /** Create the default invokation object */
+ EndpointInvocation createInvocation();
+
/** Create the invocation handler */
void create(Endpoint ep);
@@ -40,7 +43,7 @@
void start(Endpoint ep);
/** Invoke the the service endpoint */
- void invoke(Endpoint ep, EndpointInvocation inv) throws Exception;
+ void invoke(Endpoint ep, Object beanInstance, EndpointInvocation inv) throws Exception;
/** Stop the invocation handler */
void stop(Endpoint ep);
Modified: trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/InvocationHandlerJSE.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/InvocationHandlerJSE.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/spi/src/main/java/org/jboss/wsintegration/spi/invocation/InvocationHandlerJSE.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -25,8 +25,6 @@
import java.lang.reflect.Method;
-import javax.xml.rpc.server.ServiceLifecycle;
-import javax.xml.rpc.server.ServletEndpointContext;
import javax.xml.ws.WebServiceContext;
import org.jboss.wsintegration.spi.deployment.Endpoint;
@@ -39,48 +37,30 @@
*/
public class InvocationHandlerJSE extends AbstractInvocationHandler
{
- protected Object getTargetBean(Endpoint ep) throws InstantiationException, IllegalAccessException
+ protected Object getBeanInstance(Endpoint ep) throws InstantiationException, IllegalAccessException
{
Class epImpl = ep.getTargetBean();
Object targetBean = epImpl.newInstance();
return targetBean;
}
- public void invoke(Endpoint ep, EndpointInvocation epInv) throws Exception
+ public void invoke(Endpoint ep, Object beanInstance, EndpointInvocation epInv) throws Exception
{
try
{
- Object targetBean = getTargetBean(ep);
-
+ if (beanInstance == null)
+ beanInstance = getBeanInstance(ep);
+
InvocationContext invContext = epInv.getInvocationContext();
WebServiceContext wsContext = invContext.getAttachment(WebServiceContext.class);
if (wsContext != null)
{
- new WebServiceContextInjector().injectContext(targetBean, (WebServiceContext)wsContext);
+ new WebServiceContextInjector().injectContext(beanInstance, (WebServiceContext)wsContext);
}
- if (targetBean instanceof ServiceLifecycle)
- {
- ServletEndpointContext sepContext = invContext.getAttachment(ServletEndpointContext.class);
- if (sepContext == null)
- throw new IllegalStateException("Cannot obtain ServletEndpointContext");
-
- ((ServiceLifecycle)targetBean).init(sepContext);
- }
-
- try
- {
- Method method = getImplMethod(ep.getTargetBean(), epInv.getJavaMethod());
- Object retObj = method.invoke(targetBean, epInv.getArgs());
- epInv.setReturnValue(retObj);
- }
- finally
- {
- if (targetBean instanceof ServiceLifecycle)
- {
- ((ServiceLifecycle)targetBean).destroy();
- }
- }
+ Method method = getImplMethod(beanInstance.getClass(), epInv.getJavaMethod());
+ Object retObj = method.invoke(beanInstance, epInv.getArgs());
+ epInv.setReturnValue(retObj);
}
catch (Exception e)
{
Modified: trunk/integration/sunri/ant-import/build-deploy.xml
===================================================================
--- trunk/integration/sunri/ant-import/build-deploy.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/sunri/ant-import/build-deploy.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -37,7 +37,7 @@
</copy>
<copy todir="${jboss50.home}/server/${jboss.server.instance}/lib" overwrite="true">
<fileset dir="${spi.dir}/output/lib">
- <include name="jbossws-integration.jar"/>
+ <include name="jbossws-spi.jar"/>
</fileset>
</copy>
<mkdir dir="${jboss50.home}/server/${jboss.server.instance}/deployers/jbossws.deployer"/>
Modified: trunk/integration/sunri/ant-import/build-testsuite.xml
===================================================================
--- trunk/integration/sunri/ant-import/build-testsuite.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/sunri/ant-import/build-testsuite.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -62,7 +62,7 @@
<!-- The combined compile classpath -->
<path id="javac.classpath">
<path refid="sunri.classpath"/>
- <pathelement location="${spi.dir}/output/lib/jbossws-integration.jar"/>
+ <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
<pathelement location="${jboss.client}/jboss-common-core.jar"/>
<pathelement location="${jboss.client}/jboss-logging-spi.jar"/>
<pathelement location="${jboss.server.lib}/jboss-javaee.jar"/>
Modified: trunk/integration/sunri/ant-import/build-thirdparty.xml
===================================================================
--- trunk/integration/sunri/ant-import/build-thirdparty.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/sunri/ant-import/build-thirdparty.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -70,7 +70,7 @@
<!-- The compile classpath for jboss50 integration -->
<path id="sunri50.integration.classpath">
- <pathelement location="${spi.dir}/output/lib/jbossws-integration.jar"/>
+ <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
<pathelement location="${jboss50.lib}/jboss-aop-jdk50.jar"/>
<pathelement location="${jboss50.lib}/jboss-common-core.jar"/>
<pathelement location="${jboss50.lib}/jboss-dependency.jar"/>
Added: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/DeploymentDescriptorParserExt.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/DeploymentDescriptorParserExt.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/DeploymentDescriptorParserExt.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -0,0 +1,602 @@
+/*
+ * 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.wsintegration.stack.sunri;
+
+// $Id$
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.http.HTTPBinding;
+import javax.xml.ws.soap.MTOMFeature;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.xml.sax.EntityResolver;
+
+import com.sun.istack.NotNull;
+import com.sun.xml.ws.api.BindingID;
+import com.sun.xml.ws.api.WSBinding;
+import com.sun.xml.ws.api.server.Container;
+import com.sun.xml.ws.api.server.InstanceResolver;
+import com.sun.xml.ws.api.server.Invoker;
+import com.sun.xml.ws.api.server.SDDocumentSource;
+import com.sun.xml.ws.api.server.WSEndpoint;
+import com.sun.xml.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.ws.binding.WebServiceFeatureList;
+import com.sun.xml.ws.handler.HandlerChainsModel;
+import com.sun.xml.ws.resources.ServerMessages;
+import com.sun.xml.ws.resources.WsservletMessages;
+import com.sun.xml.ws.server.EndpointFactory;
+import com.sun.xml.ws.server.ServerRtException;
+import com.sun.xml.ws.streaming.Attributes;
+import com.sun.xml.ws.streaming.TidyXMLStreamReader;
+import com.sun.xml.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.ws.transport.http.HttpAdapter;
+import com.sun.xml.ws.transport.http.ResourceLoader;
+import com.sun.xml.ws.transport.http.DeploymentDescriptorParser.AdapterFactory;
+import com.sun.xml.ws.util.HandlerAnnotationInfo;
+import com.sun.xml.ws.util.exception.LocatableWebServiceException;
+import com.sun.xml.ws.util.xml.XmlUtil;
+
+/**
+ * A copy of DeploymentDescriptorParser that externalizes
+ *
+ * {@link createInvoker(Class)}
+ *
+ *
+ * @author WS Development Team
+ * @author Kohsuke Kawaguchi
+ * @author Thomas.Diesler at jboss.org
+ * @since 10-May-2007
+ */
+public class DeploymentDescriptorParserExt<A>
+{
+ private final Container container;
+ private final ClassLoader classLoader;
+ private final ResourceLoader loader;
+ private final AdapterFactory<A> adapterFactory;
+
+ /**
+ * Endpoint names that are declared.
+ * Used to catch double definitions.
+ */
+ private final Set<String> names = new HashSet<String>();
+
+ /**
+ * WSDL/schema documents collected from /WEB-INF/wsdl. Keyed by the system ID.
+ */
+ private final Map<String, SDDocumentSource> docs = new HashMap<String, SDDocumentSource>();
+
+ /**
+ *
+ * @param cl
+ * Used to load service implementations.
+ * @param loader
+ * Used to locate resources, in particular WSDL.
+ * @param container
+ * Optional {@link Container} that {@link WSEndpoint}s receive.
+ * @param adapterFactory
+ * Creates {@link HttpAdapter} (or its derived class.)
+ */
+ public DeploymentDescriptorParserExt(ClassLoader cl, ResourceLoader loader, Container container, AdapterFactory<A> adapterFactory) throws MalformedURLException
+ {
+ classLoader = cl;
+ this.loader = loader;
+ this.container = container;
+ this.adapterFactory = adapterFactory;
+
+ collectDocs("/WEB-INF/wsdl/");
+ logger.fine("war metadata=" + docs);
+ }
+
+ /**
+ * Parses the {@code sun-jaxws.xml} file and configures
+ * a set of {@link HttpAdapter}s.
+ */
+ public @NotNull
+ List<A> parse(String systemId, InputStream is)
+ {
+ XMLStreamReader reader = null;
+ try
+ {
+ reader = new TidyXMLStreamReader(XMLStreamReaderFactory.create(systemId, is, true), is);
+ XMLStreamReaderUtil.nextElementContent(reader);
+ return parseAdapters(reader);
+ }
+ finally
+ {
+ if (reader != null)
+ {
+ try
+ {
+ reader.close();
+ }
+ catch (XMLStreamException e)
+ {
+ throw new ServerRtException("runtime.parser.xmlReader", e);
+ }
+ }
+ try
+ {
+ is.close();
+ }
+ catch (IOException e)
+ {
+ // ignore
+ }
+ }
+ }
+
+ /**
+ * Parses the {@code sun-jaxws.xml} file and configures
+ * a set of {@link HttpAdapter}s.
+ */
+ public @NotNull
+ List<A> parse(File f) throws IOException
+ {
+ FileInputStream in = new FileInputStream(f);
+ try
+ {
+ return parse(f.getPath(), in);
+ }
+ finally
+ {
+ in.close();
+ }
+ }
+
+ /**
+ * Get all the WSDL & schema documents recursively.
+ */
+ private void collectDocs(String dirPath) throws MalformedURLException
+ {
+ Set<String> paths = loader.getResourcePaths(dirPath);
+ if (paths != null)
+ {
+ for (String path : paths)
+ {
+ if (path.endsWith("/"))
+ {
+ collectDocs(path);
+ }
+ else
+ {
+ URL res = loader.getResource(path);
+ docs.put(res.toString(), SDDocumentSource.create(res));
+ }
+ }
+ }
+ }
+
+ private List<A> parseAdapters(XMLStreamReader reader)
+ {
+ if (!reader.getName().equals(QNAME_ENDPOINTS))
+ {
+ failWithFullName("runtime.parser.invalidElement", reader);
+ }
+
+ List<A> adapters = new ArrayList<A>();
+
+ Attributes attrs = XMLStreamReaderUtil.getAttributes(reader);
+ String version = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_VERSION);
+ if (!version.equals(ATTRVALUE_VERSION_1_0))
+ {
+ failWithLocalName("runtime.parser.invalidVersionNumber", reader, version);
+ }
+
+ while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT)
+ if (reader.getName().equals(QNAME_ENDPOINT))
+ {
+
+ attrs = XMLStreamReaderUtil.getAttributes(reader);
+ String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME);
+ if (!names.add(name))
+ {
+ logger.warning(WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/));
+ }
+
+ String implementationName = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION);
+ Class<?> implementorClass = getImplementorClass(implementationName, reader);
+ EndpointFactory.verifyImplementorClass(implementorClass);
+
+ SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass);
+
+ QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE);
+ if (serviceName == null)
+ serviceName = EndpointFactory.getDefaultServiceName(implementorClass);
+
+ QName portName = getQNameAttribute(attrs, ATTR_PORT);
+ if (portName == null)
+ portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass);
+
+ //get enable-mtom attribute value
+ String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM);
+ String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE);
+ String bindingId = getAttribute(attrs, ATTR_BINDING);
+ if (bindingId != null)
+ // Convert short-form tokens to API's binding ids
+ bindingId = getBindingIdForToken(bindingId);
+ WSBinding binding = createBinding(bindingId, implementorClass, enable_mtom, mtomThreshold);
+ String urlPattern = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN);
+
+ // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary.
+
+ boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName);
+
+ ensureNoContent(reader);
+ Invoker invoker = createInvoker(implementorClass);
+ WSEndpoint<?> endpoint = WSEndpoint.create(implementorClass, !handlersSetInDD, invoker,
+ serviceName, portName, container, binding, primaryWSDL, docs.values(), createEntityResolver(), false);
+ adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint));
+ }
+ else
+ {
+ failWithLocalName("runtime.parser.invalidElement", reader);
+ }
+ return adapters;
+ }
+
+ protected Invoker createInvoker(Class<?> implementorClass)
+ {
+ Invoker invoker = InstanceResolver.createDefault(implementorClass).createInvoker();
+ return invoker;
+ }
+
+ /**
+ * @param ddBindingId
+ * binding id explicitlyspecified in the DeploymentDescriptor or parameter
+ * @param implClass
+ * Endpoint Implementation class
+ * @param mtomEnabled
+ * represents mtom-enabled attribute in DD
+ * @param mtomThreshold
+ * threshold value specified in DD
+ * @return
+ * is returned with only MTOMFeature set resolving the various precendece rules
+ */
+ private static WSBinding createBinding(String ddBindingId, Class implClass, String mtomEnabled, String mtomThreshold)
+ {
+ // Features specified through DD
+ WebServiceFeatureList features;
+
+ MTOMFeature mtomfeature = null;
+ if (mtomEnabled != null)
+ {
+ if (mtomThreshold != null)
+ mtomfeature = new MTOMFeature(Boolean.valueOf(mtomEnabled), Integer.valueOf(mtomThreshold));
+ else mtomfeature = new MTOMFeature(Boolean.valueOf(mtomEnabled));
+ }
+
+ BindingID bindingID;
+ if (ddBindingId != null)
+ {
+ bindingID = BindingID.parse(ddBindingId);
+ features = bindingID.createBuiltinFeatureList();
+
+ if (checkMtomConflict(features.get(MTOMFeature.class), mtomfeature))
+ {
+ throw new ServerRtException(ServerMessages.DD_MTOM_CONFLICT(ddBindingId, mtomEnabled));
+ }
+ }
+ else
+ {
+ bindingID = BindingID.parse(implClass);
+ // Since bindingID is coming from implclass,
+ // mtom through Feature annotation or DD takes precendece
+
+ features = new WebServiceFeatureList();
+ if (mtomfeature != null)
+ features.add(mtomfeature); // this wins over MTOM setting in bindingID
+ features.addAll(bindingID.createBuiltinFeatureList());
+ }
+
+ return bindingID.createBinding(features.toArray());
+ }
+
+ private static boolean checkMtomConflict(MTOMFeature lhs, MTOMFeature rhs)
+ {
+ if (lhs == null || rhs == null)
+ return false;
+ return lhs.isEnabled() ^ rhs.isEnabled();
+ }
+
+ /**
+ * JSR-109 defines short-form tokens for standard binding Ids. These are
+ * used only in DD. So stand alone deployment descirptor should also honor
+ * these tokens. This method converts the tokens to API's standard
+ * binding ids
+ *
+ * @param lexical binding attribute value from DD. Always not null
+ *
+ * @return returns corresponding API's binding ID or the same lexical
+ */
+ public static @NotNull
+ String getBindingIdForToken(@NotNull
+ String lexical)
+ {
+ if (lexical.equals("##SOAP11_HTTP"))
+ {
+ return SOAPBinding.SOAP11HTTP_BINDING;
+ }
+ else if (lexical.equals("##SOAP11_HTTP_MTOM"))
+ {
+ return SOAPBinding.SOAP11HTTP_MTOM_BINDING;
+ }
+ else if (lexical.equals("##SOAP12_HTTP"))
+ {
+ return SOAPBinding.SOAP12HTTP_BINDING;
+ }
+ else if (lexical.equals("##SOAP12_HTTP_MTOM"))
+ {
+ return SOAPBinding.SOAP12HTTP_MTOM_BINDING;
+ }
+ else if (lexical.equals("##XML_HTTP"))
+ {
+ return HTTPBinding.HTTP_BINDING;
+ }
+ return lexical;
+ }
+
+ /**
+ * Checks the deployment descriptor or {@link @WebServiceProvider} annotation
+ * to see if it points to any WSDL. If so, returns the {@link SDDocumentSource}.
+ *
+ * @return
+ * The pointed WSDL, if any. Otherwise null.
+ */
+ private SDDocumentSource getPrimaryWSDL(XMLStreamReader xsr, Attributes attrs, Class<?> implementorClass)
+ {
+
+ String wsdlFile = getAttribute(attrs, ATTR_WSDL);
+ if (wsdlFile == null)
+ {
+ wsdlFile = EndpointFactory.getWsdlLocation(implementorClass);
+ }
+
+ if (wsdlFile != null)
+ {
+ if (!wsdlFile.startsWith(JAXWS_WSDL_DD_DIR))
+ {
+ logger.warning("Ignoring wrong wsdl=" + wsdlFile + ". It should start with " + JAXWS_WSDL_DD_DIR + ". Going to generate and publish a new WSDL.");
+ return null;
+ }
+
+ URL wsdl;
+ try
+ {
+ wsdl = loader.getResource('/' + wsdlFile);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new LocatableWebServiceException(ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), e, xsr);
+ }
+ if (wsdl == null)
+ {
+ throw new LocatableWebServiceException(ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), xsr);
+ }
+ SDDocumentSource docInfo = docs.get(wsdl.toExternalForm());
+ assert docInfo != null;
+ return docInfo;
+ }
+
+ return null;
+ }
+
+ /**
+ * Creates an {@link EntityResolver} that consults {@code /WEB-INF/jax-ws-catalog.xml}.
+ */
+ private EntityResolver createEntityResolver()
+ {
+ try
+ {
+ return XmlUtil.createEntityResolver(loader.getCatalogFile());
+ }
+ catch (MalformedURLException e)
+ {
+ throw new WebServiceException(e);
+ }
+ }
+
+ protected String getAttribute(Attributes attrs, String name)
+ {
+ String value = attrs.getValue(name);
+ if (value != null)
+ {
+ value = value.trim();
+ }
+ return value;
+ }
+
+ protected QName getQNameAttribute(Attributes attrs, String name)
+ {
+ String value = getAttribute(attrs, name);
+ if (value == null || value.equals(""))
+ {
+ return null;
+ }
+ else
+ {
+ return QName.valueOf(value);
+ }
+ }
+
+ protected String getNonEmptyAttribute(XMLStreamReader reader, Attributes attrs, String name)
+ {
+ String value = getAttribute(attrs, name);
+ if (value != null && value.equals(""))
+ {
+ failWithLocalName("runtime.parser.invalidAttributeValue", reader, name);
+ }
+ return value;
+ }
+
+ protected String getMandatoryAttribute(XMLStreamReader reader, Attributes attrs, String name)
+ {
+ String value = getAttribute(attrs, name);
+ if (value == null)
+ {
+ failWithLocalName("runtime.parser.missing.attribute", reader, name);
+ }
+ return value;
+ }
+
+ protected String getMandatoryNonEmptyAttribute(XMLStreamReader reader, Attributes attributes, String name)
+ {
+ String value = getAttribute(attributes, name);
+ if (value == null)
+ {
+ failWithLocalName("runtime.parser.missing.attribute", reader, name);
+ }
+ else if (value.equals(""))
+ {
+ failWithLocalName("runtime.parser.invalidAttributeValue", reader, name);
+ }
+ return value;
+ }
+
+ /**
+ * Parses the handler and role information and sets it
+ * on the {@link WSBinding}.
+ * @return true if <handler-chains> element present in DD
+ * false otherwise.
+ */
+ protected boolean setHandlersAndRoles(WSBinding binding, XMLStreamReader reader, QName serviceName, QName portName)
+ {
+
+ if (XMLStreamReaderUtil.nextElementContent(reader) == XMLStreamConstants.END_ELEMENT || !reader.getName().equals(HandlerChainsModel.QNAME_HANDLER_CHAINS))
+ {
+
+ return false;
+ }
+
+ HandlerAnnotationInfo handlerInfo = HandlerChainsModel.parseHandlerFile(reader, classLoader, serviceName, portName, binding);
+
+ binding.setHandlerChain(handlerInfo.getHandlers());
+ if (binding instanceof SOAPBinding)
+ {
+ ((SOAPBinding)binding).setRoles(handlerInfo.getRoles());
+ }
+
+ // move past </handler-chains>
+ XMLStreamReaderUtil.nextContent(reader);
+ return true;
+ }
+
+ protected static void ensureNoContent(XMLStreamReader reader)
+ {
+ if (reader.getEventType() != XMLStreamConstants.END_ELEMENT)
+ {
+ fail("runtime.parser.unexpectedContent", reader);
+ }
+ }
+
+ protected static void fail(String key, XMLStreamReader reader)
+ {
+ logger.log(Level.SEVERE, key + reader.getLocation().getLineNumber());
+ throw new ServerRtException(key, Integer.toString(reader.getLocation().getLineNumber()));
+ }
+
+ protected static void failWithFullName(String key, XMLStreamReader reader)
+ {
+ throw new ServerRtException(key, reader.getLocation().getLineNumber(), reader.getName());
+ }
+
+ protected static void failWithLocalName(String key, XMLStreamReader reader)
+ {
+ throw new ServerRtException(key, reader.getLocation().getLineNumber(), reader.getLocalName());
+ }
+
+ protected static void failWithLocalName(String key, XMLStreamReader reader, String arg)
+ {
+ throw new ServerRtException(key, reader.getLocation().getLineNumber(), reader.getLocalName(), arg);
+ }
+
+ protected Class loadClass(String name)
+ {
+ try
+ {
+ return Class.forName(name, true, classLoader);
+ }
+ catch (ClassNotFoundException e)
+ {
+ logger.log(Level.SEVERE, e.getMessage(), e);
+ throw new ServerRtException("runtime.parser.classNotFound", name);
+ }
+ }
+
+ /**
+ * Loads the class of the given name.
+ *
+ * @param xsr
+ * Used to report the source location information if there's any error.
+ */
+ private Class getImplementorClass(String name, XMLStreamReader xsr)
+ {
+ try
+ {
+ return Class.forName(name, true, classLoader);
+ }
+ catch (ClassNotFoundException e)
+ {
+ logger.log(Level.SEVERE, e.getMessage(), e);
+ throw new LocatableWebServiceException(ServerMessages.RUNTIME_PARSER_CLASS_NOT_FOUND(name), e, xsr);
+ }
+ }
+
+ public static final String NS_RUNTIME = "http://java.sun.com/xml/ns/jax-ws/ri/runtime";
+
+ public static final String JAXWS_WSDL_DD_DIR = "WEB-INF/wsdl";
+
+ public static final QName QNAME_ENDPOINTS = new QName(NS_RUNTIME, "endpoints");
+ public static final QName QNAME_ENDPOINT = new QName(NS_RUNTIME, "endpoint");
+
+ public static final String ATTR_VERSION = "version";
+ public static final String ATTR_NAME = "name";
+ public static final String ATTR_IMPLEMENTATION = "implementation";
+ public static final String ATTR_WSDL = "wsdl";
+ public static final String ATTR_SERVICE = "service";
+ public static final String ATTR_PORT = "port";
+ public static final String ATTR_URL_PATTERN = "url-pattern";
+ public static final String ATTR_ENABLE_MTOM = "enable-mtom";
+ public static final String ATTR_MTOM_THRESHOLD_VALUE = "mtom-threshold-value";
+ public static final String ATTR_BINDING = "binding";
+
+ public static final String ATTRVALUE_VERSION_1_0 = "2.0";
+ private static final Logger logger = Logger.getLogger(com.sun.xml.ws.util.Constants.LoggingDomain + ".server.http");
+}
Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/DeploymentDescriptorParserExt.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/DeploymentDescriptorParserJBWS.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/DeploymentDescriptorParserJBWS.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/DeploymentDescriptorParserJBWS.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -0,0 +1,67 @@
+/*
+ * 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.wsintegration.stack.sunri;
+
+// $Id$
+
+import java.net.MalformedURLException;
+
+import javax.ejb.Stateless;
+
+import com.sun.xml.ws.api.server.Container;
+import com.sun.xml.ws.api.server.InstanceResolver;
+import com.sun.xml.ws.api.server.Invoker;
+import com.sun.xml.ws.transport.http.ResourceLoader;
+import com.sun.xml.ws.transport.http.DeploymentDescriptorParser.AdapterFactory;
+
+/**
+ * A copy of DeploymentDescriptorParser that externalizes
+ *
+ * createInvoker(Class)
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 10-May-2007
+ */
+public class DeploymentDescriptorParserJBWS<A> extends DeploymentDescriptorParserExt<A>
+{
+ public DeploymentDescriptorParserJBWS(ClassLoader cl, ResourceLoader loader, Container container, AdapterFactory<A> adapterFactory) throws MalformedURLException
+ {
+ super(cl, loader, container, adapterFactory);
+ }
+
+ @Override
+ protected Invoker createInvoker(Class<?> implClass)
+ {
+ Invoker invoker;
+ InstanceResolver<?> resolver = InstanceResolver.createDefault(implClass);
+ if (implClass.isAnnotationPresent(Stateless.class))
+ {
+ invoker = new InvokerEJB3(resolver);
+ }
+ else
+ {
+ invoker = new InvokerJSE(resolver);
+ }
+ return invoker;
+ }
+
+}
Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/DeploymentDescriptorParserJBWS.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/EndpointAssociation.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/EndpointAssociation.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/EndpointAssociation.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -0,0 +1,52 @@
+/*
+ * 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.wsintegration.stack.sunri;
+
+// $Id$
+
+import org.jboss.wsintegration.spi.deployment.Endpoint;
+
+/**
+ * Associates the endpoint meta data with the current thead.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 10-May-2007
+ */
+public final class EndpointAssociation
+{
+ private static final ThreadLocal<Endpoint> endpoint = new ThreadLocal<Endpoint>();
+
+ public static void setEndpoint(Endpoint ep)
+ {
+ endpoint.set(ep);
+ }
+
+ public static Endpoint getEndpoint()
+ {
+ return endpoint.get();
+ }
+
+ public static void removeEndpoint()
+ {
+ endpoint.remove();
+ }
+}
Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/EndpointAssociation.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/EndpointNameDeployer.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/EndpointNameDeployer.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/EndpointNameDeployer.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -24,6 +24,7 @@
//$Id$
import org.jboss.metadata.WebMetaData;
+import org.jboss.wsintegration.spi.annotation.WebContext;
import org.jboss.wsintegration.spi.deployment.AbstractDeployer;
import org.jboss.wsintegration.spi.deployment.Deployment;
import org.jboss.wsintegration.spi.deployment.Endpoint;
@@ -45,14 +46,19 @@
if (webMetaData != null)
contextRoot = webMetaData.getContextRoot();
- if (contextRoot == null)
- throw new IllegalStateException("Cannot obtain context root");
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ Class implClass = ep.getTargetBean();
+ WebContext anWebContext = (WebContext)implClass.getAnnotation(WebContext.class);
+ if (anWebContext != null && anWebContext.contextRoot().length() > 0)
+ contextRoot = anWebContext.contextRoot();
- if (contextRoot.startsWith("/"))
- contextRoot = contextRoot.substring(1);
+ if (contextRoot == null)
+ throw new IllegalStateException("Cannot obtain context root");
- for (Endpoint ep : dep.getService().getEndpoints())
- {
+ if (contextRoot.startsWith("/"))
+ contextRoot = contextRoot.substring(1);
+
StringBuilder name = new StringBuilder(ep.getName().getCanonicalName());
if (ep.getName().getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT) == null)
name.append("," + Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextRoot);
Added: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/InvokerEJB3.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/InvokerEJB3.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/InvokerEJB3.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -0,0 +1,78 @@
+/*
+ * 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.wsintegration.stack.sunri;
+
+// $Id$
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.xml.ws.Provider;
+
+import com.sun.istack.NotNull;
+import com.sun.xml.ws.api.message.Packet;
+import com.sun.xml.ws.api.server.InstanceResolver;
+import com.sun.xml.ws.api.server.Invoker;
+import com.sun.xml.ws.api.server.WSEndpoint;
+import com.sun.xml.ws.api.server.WSWebServiceContext;
+
+/**
+ * An invoker for EJB3 endpoints
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 10-May-2007
+ */
+public class InvokerEJB3 extends Invoker
+{
+ private final InstanceResolver resolver;
+
+ public InvokerEJB3(InstanceResolver resolver)
+ {
+ this.resolver = resolver;
+ }
+
+ @Override
+ public void start(@NotNull WSWebServiceContext wsc, @NotNull WSEndpoint endpoint)
+ {
+ resolver.start(wsc, endpoint);
+ }
+
+ @Override
+ public void dispose()
+ {
+ resolver.dispose();
+ }
+
+ @Override
+ public <T> T invokeProvider(@NotNull Packet p, T arg)
+ {
+ Object targetBean = resolver.resolve(p);
+ return ((Provider<T>)targetBean).invoke(arg);
+ }
+
+ @Override
+ public Object invoke(Packet p, Method m, Object... args) throws InvocationTargetException, IllegalAccessException
+ {
+ Object targetBean = resolver.resolve(p);
+ return m.invoke(targetBean, args);
+ }
+}
Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/InvokerEJB3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/InvokerJSE.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/InvokerJSE.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/InvokerJSE.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -0,0 +1,115 @@
+/*
+ * 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.wsintegration.stack.sunri;
+
+// $Id$
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.xml.ws.Provider;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.wsintegration.spi.deployment.Endpoint;
+import org.jboss.wsintegration.spi.invocation.EndpointInvocation;
+import org.jboss.wsintegration.spi.invocation.InvocationHandler;
+
+import com.sun.istack.NotNull;
+import com.sun.xml.ws.api.message.Packet;
+import com.sun.xml.ws.api.server.InstanceResolver;
+import com.sun.xml.ws.api.server.Invoker;
+import com.sun.xml.ws.api.server.WSEndpoint;
+import com.sun.xml.ws.api.server.WSWebServiceContext;
+
+/**
+ * An invoker for JSE endpoints
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 10-May-2007
+ */
+public class InvokerJSE extends Invoker
+{
+ private final InstanceResolver resolver;
+
+ public InvokerJSE(InstanceResolver resolver)
+ {
+ this.resolver = resolver;
+ }
+
+ @Override
+ public void start(@NotNull
+ WSWebServiceContext wsc, @NotNull
+ WSEndpoint endpoint)
+ {
+ resolver.start(wsc, endpoint);
+ }
+
+ @Override
+ public void dispose()
+ {
+ resolver.dispose();
+ }
+
+ @Override
+ public <T> T invokeProvider(@NotNull
+ Packet p, T arg)
+ {
+ Object targetBean = resolver.resolve(p);
+ return ((Provider<T>)targetBean).invoke(arg);
+ }
+
+ @Override
+ public Object invoke(Packet p, Method m, Object... args) throws InvocationTargetException, IllegalAccessException
+ {
+ Endpoint ep = EndpointAssociation.getEndpoint();
+
+ InvocationHandler invHandler = ep.getInvocationHandler();
+ EndpointInvocation inv = invHandler.createInvocation();
+ inv.setJavaMethod(m);
+ inv.setArgs(args);
+
+ Object retObj = null;
+ try
+ {
+ Object targetBean = resolver.resolve(p);
+ invHandler.invoke(ep, targetBean, inv);
+ retObj = inv.getReturnValue();
+ }
+ catch (Exception ex)
+ {
+ handleException(ex);
+ }
+
+ return retObj;
+ }
+
+ private void handleException(Exception ex) throws InvocationTargetException, IllegalAccessException
+ {
+ if (ex instanceof InvocationTargetException)
+ throw (InvocationTargetException)ex;
+
+ if (ex instanceof IllegalAccessException)
+ throw (IllegalAccessException)ex;
+
+ throw new WebServiceException(ex);
+ }
+}
Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/InvokerJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/ModifyWebMetaDataDeployer.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/ModifyWebMetaDataDeployer.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/ModifyWebMetaDataDeployer.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -70,7 +70,7 @@
// Add the path to sun-jaxws.xml
ParamValue ctxParam = new ParamValue();
ctxParam.setType(ParamType.CONTEXT_PARAM);
- ctxParam.setName(WSServletContextListener.PARAM_SUN_JAXWS_URL);
+ ctxParam.setName(WSServletContextListenerJBWS.PARAM_SUN_JAXWS_URL);
ctxParam.setValue(ddSunJaxws.createFileURL().toExternalForm());
webMetaData.addContextParam(ctxParam);
Deleted: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSEndpointServlet.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSEndpointServlet.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSEndpointServlet.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -1,98 +0,0 @@
-/*
- * 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.wsintegration.stack.sunri;
-
-// $Id$
-
-import java.io.IOException;
-
-import javax.management.ObjectName;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.wsintegration.spi.deployment.Endpoint;
-import org.jboss.wsintegration.spi.invocation.RequestHandler;
-import org.jboss.wsintegration.spi.management.EndpointRegistry;
-import org.jboss.wsintegration.spi.management.EndpointRegistryFactory;
-import org.jboss.wsintegration.spi.utils.ObjectNameFactory;
-
-/**
- * The JAX-WS dispatcher servlet.
- *
- * @author WS Development Team
- * @author Thomas.Diesler at jboss.org
- * @since 10-May-2007
- */
-public class WSEndpointServlet extends HttpServlet
-{
- protected Endpoint endpoint;
- protected EndpointRegistry epRegistry;
-
- public void init(ServletConfig servletConfig) throws ServletException
- {
- super.init(servletConfig);
- epRegistry = EndpointRegistryFactory.getEndpointRegistry();
- }
-
- public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
- {
- if (endpoint == null)
- {
- String contextPath = req.getContextPath();
- initServiceEndpoint(contextPath);
- }
-
- RequestHandler requestHandler = (RequestHandler)endpoint.getRequestHandler();
- requestHandler.handleHttpRequest(endpoint, req, res, getServletContext());
- }
-
- /** Initialize the service endpoint
- */
- protected void initServiceEndpoint(String contextPath)
- {
- if (contextPath.startsWith("/"))
- contextPath = contextPath.substring(1);
-
- String servletName = getServletName();
- for (ObjectName sepId : epRegistry.getEndpoints())
- {
- String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
- String propEndpoint = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
- if (servletName.equals(propEndpoint) && contextPath.equals(propContext))
- {
- endpoint = epRegistry.getEndpoint(sepId);
- break;
- }
- }
-
- if (endpoint == null)
- {
- ObjectName oname = ObjectNameFactory.create(Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextPath + ","
- + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName);
- throw new WebServiceException("Cannot obtain endpoint for: " + oname);
- }
- }
-}
Added: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSEndpointServletJBWS.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSEndpointServletJBWS.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSEndpointServletJBWS.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -0,0 +1,106 @@
+/*
+ * 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.wsintegration.stack.sunri;
+
+// $Id$
+
+import java.io.IOException;
+
+import javax.management.ObjectName;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.wsintegration.spi.deployment.Endpoint;
+import org.jboss.wsintegration.spi.invocation.RequestHandler;
+import org.jboss.wsintegration.spi.management.EndpointRegistry;
+import org.jboss.wsintegration.spi.management.EndpointRegistryFactory;
+import org.jboss.wsintegration.spi.utils.ObjectNameFactory;
+
+/**
+ * The JAX-WS dispatcher servlet.
+ *
+ * @author WS Development Team
+ * @author Thomas.Diesler at jboss.org
+ * @since 10-May-2007
+ */
+public class WSEndpointServletJBWS extends HttpServlet
+{
+ protected Endpoint endpoint;
+ protected EndpointRegistry epRegistry;
+
+ public void init(ServletConfig servletConfig) throws ServletException
+ {
+ super.init(servletConfig);
+ epRegistry = EndpointRegistryFactory.getEndpointRegistry();
+ }
+
+ public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ if (endpoint == null)
+ {
+ String contextPath = req.getContextPath();
+ initServiceEndpoint(contextPath);
+ }
+
+ try
+ {
+ EndpointAssociation.setEndpoint(endpoint);
+ RequestHandler requestHandler = (RequestHandler)endpoint.getRequestHandler();
+ requestHandler.handleHttpRequest(endpoint, req, res, getServletContext());
+ }
+ finally
+ {
+ EndpointAssociation.removeEndpoint();
+ }
+ }
+
+ /** Initialize the service endpoint
+ */
+ protected void initServiceEndpoint(String contextPath)
+ {
+ if (contextPath.startsWith("/"))
+ contextPath = contextPath.substring(1);
+
+ String servletName = getServletName();
+ for (ObjectName sepId : epRegistry.getEndpoints())
+ {
+ String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
+ String propEndpoint = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
+ if (servletName.equals(propEndpoint) && contextPath.equals(propContext))
+ {
+ endpoint = epRegistry.getEndpoint(sepId);
+ break;
+ }
+ }
+
+ if (endpoint == null)
+ {
+ ObjectName oname = ObjectNameFactory.create(Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextPath + ","
+ + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName);
+ throw new WebServiceException("Cannot obtain endpoint for: " + oname);
+ }
+ }
+}
Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSEndpointServletJBWS.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListener.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListener.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListener.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -1,180 +0,0 @@
-/*
- * 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.wsintegration.stack.sunri;
-
-// $Id$
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextAttributeEvent;
-import javax.servlet.ServletContextAttributeListener;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.xml.ws.WebServiceException;
-
-import com.sun.istack.NotNull;
-import com.sun.xml.ws.api.server.BoundEndpoint;
-import com.sun.xml.ws.api.server.Container;
-import com.sun.xml.ws.api.server.Module;
-import com.sun.xml.ws.resources.WsservletMessages;
-import com.sun.xml.ws.transport.http.DeploymentDescriptorParser;
-import com.sun.xml.ws.transport.http.HttpAdapter;
-import com.sun.xml.ws.transport.http.servlet.ServletAdapter;
-import com.sun.xml.ws.transport.http.servlet.ServletAdapterList;
-import com.sun.xml.ws.transport.http.servlet.WSServlet;
-import com.sun.xml.ws.transport.http.servlet.WSServletDelegate;
-
-/**
- * Parses {@code sun-jaxws.xml} and sets up
- * {@link HttpAdapter}s for all deployed endpoints.
- *
- * <p>
- * This code is the entry point at the server side.
- *
- * @author WS Development Team
- * @author Thomas.Diesler at jboss.org
- * @since 10-May-2007
- */
-public class WSServletContextListener implements ServletContextAttributeListener, ServletContextListener
-{
- public static final String PARAM_SUN_JAXWS_URL = "jbossws-sun-jaxws-url";
-
- private WSServletDelegate delegate;
-
- public void attributeAdded(ServletContextAttributeEvent event)
- {
- }
-
- public void attributeRemoved(ServletContextAttributeEvent event)
- {
- }
-
- public void attributeReplaced(ServletContextAttributeEvent event)
- {
- }
-
- public void contextDestroyed(ServletContextEvent event)
- {
- if (delegate != null)
- { // the deployment might have failed.
- delegate.destroy();
- }
-
- if (logger.isLoggable(Level.INFO))
- {
- logger.info(WsservletMessages.LISTENER_INFO_DESTROY());
- }
- }
-
- public void contextInitialized(ServletContextEvent event)
- {
- if (logger.isLoggable(Level.INFO))
- {
- logger.info(WsservletMessages.LISTENER_INFO_INITIALIZE());
- }
- ServletContext context = event.getServletContext();
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- if (classLoader == null)
- {
- classLoader = getClass().getClassLoader();
- }
-
- ServletContainer container = new ServletContainer(context);
- try
- {
- ServletResourceLoader resourceLoader = new ServletResourceLoader(context);
- ServletAdapterList adapterList = new ServletAdapterList();
-
- // Parse the descriptor file and build endpoint infos
- DeploymentDescriptorParser<ServletAdapter> parser = new DeploymentDescriptorParser<ServletAdapter>(classLoader, resourceLoader, container, adapterList);
-
- URL sunJaxWsXml = context.getResource(JAXWS_RI_RUNTIME);
- if (sunJaxWsXml == null)
- {
- String urlStr = context.getInitParameter(PARAM_SUN_JAXWS_URL);
- if (urlStr != null && urlStr.length() > 0)
- sunJaxWsXml = new URL(urlStr);
- }
- if (sunJaxWsXml == null)
- throw new WebServiceException(WsservletMessages.NO_SUNJAXWS_XML(JAXWS_RI_RUNTIME));
-
- List<ServletAdapter> adapters = parser.parse(sunJaxWsXml.toExternalForm(), sunJaxWsXml.openStream());
-
- delegate = new WSServletDelegate(adapters, context);
-
- context.setAttribute(WSServlet.JAXWS_RI_RUNTIME_INFO, delegate);
- }
- catch (Throwable e)
- {
- logger.log(Level.SEVERE, WsservletMessages.LISTENER_PARSING_FAILED(e), e);
- context.removeAttribute(WSServlet.JAXWS_RI_RUNTIME_INFO);
- throw new WebServiceException("listener.parsingFailed", e);
- }
- }
-
- /**
- * Provides access to {@link ServletContext} via {@link Container}. Pipes
- * can get ServletContext from Container and use it to load some resources.
- */
- private static class ServletContainer extends Container
- {
- private final ServletContext servletContext;
-
- private final Module module = new Module()
- {
- private final List<BoundEndpoint> endpoints = new ArrayList<BoundEndpoint>();
-
- public @NotNull
- List<BoundEndpoint> getBoundEndpoints()
- {
- return endpoints;
- }
- };
-
- ServletContainer(ServletContext servletContext)
- {
- this.servletContext = servletContext;
- }
-
- public <T> T getSPI(Class<T> spiType)
- {
- if (spiType == ServletContext.class)
- {
- return (T)servletContext;
- }
- if (spiType == Module.class)
- {
- return spiType.cast(module);
- }
- return null;
- }
- }
-
- private static final String JAXWS_RI_RUNTIME = "/WEB-INF/sun-jaxws.xml";
-
- private static final Logger logger = Logger.getLogger(com.sun.xml.ws.util.Constants.LoggingDomain + ".server.http");
-}
Added: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListenerExt.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListenerExt.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListenerExt.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -0,0 +1,187 @@
+/*
+ * 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.wsintegration.stack.sunri;
+
+// $Id$
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextAttributeEvent;
+import javax.servlet.ServletContextAttributeListener;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.xml.ws.WebServiceException;
+
+import com.sun.istack.NotNull;
+import com.sun.xml.ws.api.server.BoundEndpoint;
+import com.sun.xml.ws.api.server.Container;
+import com.sun.xml.ws.api.server.Module;
+import com.sun.xml.ws.resources.WsservletMessages;
+import com.sun.xml.ws.transport.http.DeploymentDescriptorParser.AdapterFactory;
+import com.sun.xml.ws.transport.http.servlet.ServletAdapter;
+import com.sun.xml.ws.transport.http.servlet.ServletAdapterList;
+import com.sun.xml.ws.transport.http.servlet.WSServlet;
+import com.sun.xml.ws.transport.http.servlet.WSServletDelegate;
+
+/**
+ * A copy of WSServletContextListener that externalizes
+ *
+ * getDeploymentDescriptorURL()
+ * createDeploymentDescriptorParser()
+ *
+ * @author WS Development Team
+ * @author Thomas.Diesler at jboss.org
+ * @since 10-May-2007
+ */
+public class WSServletContextListenerExt implements ServletContextAttributeListener, ServletContextListener
+{
+ private WSServletDelegate delegate;
+
+ public void attributeAdded(ServletContextAttributeEvent event)
+ {
+ }
+
+ public void attributeRemoved(ServletContextAttributeEvent event)
+ {
+ }
+
+ public void attributeReplaced(ServletContextAttributeEvent event)
+ {
+ }
+
+ public void contextDestroyed(ServletContextEvent event)
+ {
+ if (delegate != null)
+ { // the deployment might have failed.
+ delegate.destroy();
+ }
+
+ if (logger.isLoggable(Level.INFO))
+ {
+ logger.info(WsservletMessages.LISTENER_INFO_DESTROY());
+ }
+ }
+
+ public void contextInitialized(ServletContextEvent event)
+ {
+ if (logger.isLoggable(Level.INFO))
+ {
+ logger.info(WsservletMessages.LISTENER_INFO_INITIALIZE());
+ }
+ ServletContext context = event.getServletContext();
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ if (classLoader == null)
+ {
+ classLoader = getClass().getClassLoader();
+ }
+
+ ServletContainer container = new ServletContainer(context);
+ try
+ {
+ ServletResourceLoader resourceLoader = new ServletResourceLoader(context);
+ ServletAdapterList adapterList = new ServletAdapterList();
+
+ // Parse the descriptor file and build endpoint infos
+ DeploymentDescriptorParserExt<ServletAdapter> parser = createDeploymentDescriptorParser(classLoader, container, resourceLoader, adapterList);
+
+ URL sunJaxWsXml = getDeploymentDescriptorURL(context);
+ List<ServletAdapter> adapters = parser.parse(sunJaxWsXml.toExternalForm(), sunJaxWsXml.openStream());
+
+ delegate = new WSServletDelegate(adapters, context);
+
+ context.setAttribute(WSServlet.JAXWS_RI_RUNTIME_INFO, delegate);
+ }
+ catch (Throwable e)
+ {
+ logger.log(Level.SEVERE, WsservletMessages.LISTENER_PARSING_FAILED(e), e);
+ context.removeAttribute(WSServlet.JAXWS_RI_RUNTIME_INFO);
+ throw new WebServiceException("listener.parsingFailed", e);
+ }
+ }
+
+ /**
+ * Externalized for integration
+ */
+ protected DeploymentDescriptorParserExt<ServletAdapter> createDeploymentDescriptorParser(ClassLoader classLoader, ServletContainer container,
+ ServletResourceLoader resourceLoader, AdapterFactory<ServletAdapter> adapterList) throws MalformedURLException
+ {
+ DeploymentDescriptorParserExt<ServletAdapter> parser = new DeploymentDescriptorParserExt<ServletAdapter>(classLoader, resourceLoader, container, adapterList);
+ return parser;
+ }
+
+ /**
+ * Externalized for integration
+ */
+ protected URL getDeploymentDescriptorURL(ServletContext context) throws MalformedURLException
+ {
+ URL sunJaxWsXml = context.getResource(JAXWS_RI_RUNTIME);
+ return sunJaxWsXml;
+ }
+
+ /**
+ * Provides access to {@link ServletContext} via {@link Container}. Pipes
+ * can get ServletContext from Container and use it to load some resources.
+ */
+ static class ServletContainer extends Container
+ {
+ private final ServletContext servletContext;
+
+ private final Module module = new Module()
+ {
+ private final List<BoundEndpoint> endpoints = new ArrayList<BoundEndpoint>();
+
+ public @NotNull
+ List<BoundEndpoint> getBoundEndpoints()
+ {
+ return endpoints;
+ }
+ };
+
+ ServletContainer(ServletContext servletContext)
+ {
+ this.servletContext = servletContext;
+ }
+
+ public <T> T getSPI(Class<T> spiType)
+ {
+ if (spiType == ServletContext.class)
+ {
+ return (T)servletContext;
+ }
+ if (spiType == Module.class)
+ {
+ return spiType.cast(module);
+ }
+ return null;
+ }
+ }
+
+ protected static final String JAXWS_RI_RUNTIME = "/WEB-INF/sun-jaxws.xml";
+
+ private static final Logger logger = Logger.getLogger(com.sun.xml.ws.util.Constants.LoggingDomain + ".server.http");
+}
Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListenerExt.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListenerJBWS.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListenerJBWS.java (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListenerJBWS.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -0,0 +1,81 @@
+/*
+ * 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.wsintegration.stack.sunri;
+
+// $Id$
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.servlet.ServletContext;
+import javax.xml.ws.WebServiceException;
+
+import com.sun.xml.ws.resources.WsservletMessages;
+import com.sun.xml.ws.transport.http.HttpAdapter;
+import com.sun.xml.ws.transport.http.DeploymentDescriptorParser.AdapterFactory;
+import com.sun.xml.ws.transport.http.servlet.ServletAdapter;
+
+/**
+ * Parses {@code sun-jaxws.xml} and sets up
+ * {@link HttpAdapter}s for all deployed endpoints.
+ *
+ * <p>
+ * This code is the entry point at the server side.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 18-May-2007
+ */
+public class WSServletContextListenerJBWS extends WSServletContextListenerExt
+{
+ public static final String PARAM_SUN_JAXWS_URL = "jbossws-sun-jaxws-url";
+
+ /**
+ * Fall back to the 'jbossws-sun-jaxws-url' init parameter for the URL location
+ * of sun-jaxws.xml
+ */
+ @Override
+ protected URL getDeploymentDescriptorURL(ServletContext context) throws MalformedURLException
+ {
+ URL sunJaxWsXml = super.getDeploymentDescriptorURL(context);
+ if (sunJaxWsXml == null)
+ {
+ String urlStr = context.getInitParameter(PARAM_SUN_JAXWS_URL);
+ if (urlStr != null && urlStr.length() > 0)
+ sunJaxWsXml = new URL(urlStr);
+ }
+ if (sunJaxWsXml == null)
+ throw new WebServiceException(WsservletMessages.NO_SUNJAXWS_XML(JAXWS_RI_RUNTIME));
+
+ return sunJaxWsXml;
+ }
+
+ /**
+ * Externalized for integration
+ */
+ @Override
+ protected DeploymentDescriptorParserExt<ServletAdapter> createDeploymentDescriptorParser(ClassLoader classLoader, ServletContainer container,
+ ServletResourceLoader resourceLoader, AdapterFactory<ServletAdapter> adapterList) throws MalformedURLException
+ {
+ DeploymentDescriptorParserExt<ServletAdapter> parser = new DeploymentDescriptorParserJBWS<ServletAdapter>(classLoader, resourceLoader, container, adapterList);
+ return parser;
+ }
+}
Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsintegration/stack/sunri/WSServletContextListenerJBWS.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/integration/sunri/src/main/resources/jbossws-jboss50.sar/META-INF/jbossws-beans.xml
===================================================================
--- trunk/integration/sunri/src/main/resources/jbossws-jboss50.sar/META-INF/jbossws-beans.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/integration/sunri/src/main/resources/jbossws-jboss50.sar/META-INF/jbossws-beans.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -130,8 +130,8 @@
<bean name="WSEndpointNameDeployer" class="org.jboss.wsintegration.stack.sunri.EndpointNameDeployer"/>
<bean name="WSEndpointRegistryDeployer" class="org.jboss.wsintegration.spi.deployment.EndpointRegistryDeployer"/>
<bean name="WSModifyWebMetaDataDeployer" class="org.jboss.wsintegration.stack.sunri.ModifyWebMetaDataDeployer">
- <property name="listenerClass">org.jboss.wsintegration.stack.sunri.WSServletContextListener</property>
- <property name="servletClass">org.jboss.wsintegration.stack.sunri.WSEndpointServlet</property>
+ <property name="listenerClass">org.jboss.wsintegration.stack.sunri.WSServletContextListenerJBWS</property>
+ <property name="servletClass">org.jboss.wsintegration.stack.sunri.WSEndpointServletJBWS</property>
</bean>
<bean name="WSSunJaxwsDeployer" class="org.jboss.wsintegration.stack.sunri.SunJaxwsDeployer"/>
<bean name="WSUnifiedDeploymentInfoDeployer" class="org.jboss.wsintegration.container.jboss50.UnifiedDeploymentInfoDeployer"/>
Modified: trunk/jbossws-core/ant-import/build-thirdparty.xml
===================================================================
--- trunk/jbossws-core/ant-import/build-thirdparty.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/jbossws-core/ant-import/build-thirdparty.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -106,7 +106,7 @@
<!-- The compile classpath for jbossws core -->
<path id="thirdparty.classpath">
- <pathelement location="${spi.dir}/output/lib/jbossws-integration.jar"/>
+ <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
<pathelement location="${thirdparty.dir}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
<pathelement location="${thirdparty.dir}/ejb3.deployer/jboss-ejb3x.jar"/>
<pathelement location="${thirdparty.dir}/activation.jar"/>
Modified: trunk/jbossws-core/ant-import-tests/build-testsuite.xml
===================================================================
--- trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -28,7 +28,7 @@
<target name="tests-init" depends="jars,tests-prepare">
<path id="jbossws.classpath">
- <pathelement location="${spi.dir}/output/lib/jbossws-integration.jar"/>
+ <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
<pathelement location="${core.dir}/output/lib/jboss-jaxrpc.jar"/>
<pathelement location="${core.dir}/output/lib/jboss-jaxws.jar"/>
<pathelement location="${core.dir}/output/lib/jboss-saaj.jar"/>
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceLifecycleInvocationHandler.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceLifecycleInvocationHandler.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceLifecycleInvocationHandler.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -0,0 +1,74 @@
+/*
+ * 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.core.jaxrpc;
+
+// $Id$
+
+import javax.xml.rpc.server.ServiceLifecycle;
+import javax.xml.rpc.server.ServletEndpointContext;
+
+import org.jboss.wsintegration.spi.deployment.Endpoint;
+import org.jboss.wsintegration.spi.invocation.EndpointInvocation;
+import org.jboss.wsintegration.spi.invocation.InvocationContext;
+import org.jboss.wsintegration.spi.invocation.InvocationHandlerJSE;
+
+/**
+ * Handles invocations on JSE endpoints.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Apr-2007
+ */
+public class ServiceLifecycleInvocationHandler extends InvocationHandlerJSE
+{
+ public void invoke(Endpoint ep, Object beanInstance, EndpointInvocation epInv) throws Exception
+ {
+ try
+ {
+ if (beanInstance == null)
+ beanInstance = super.getBeanInstance(ep);
+
+ InvocationContext invContext = epInv.getInvocationContext();
+ if (beanInstance instanceof ServiceLifecycle)
+ {
+ ServletEndpointContext sepContext = invContext.getAttachment(ServletEndpointContext.class);
+ if (sepContext != null)
+ ((ServiceLifecycle)beanInstance).init(sepContext);
+ }
+
+ try
+ {
+ super.invoke(ep, beanInstance, epInv);
+ }
+ finally
+ {
+ if (beanInstance instanceof ServiceLifecycle)
+ {
+ ((ServiceLifecycle)beanInstance).destroy();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ }
+}
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceLifecycleInvocationHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -204,7 +204,7 @@
// Invoke an instance of the SEI implementation bean
EndpointInvocation inv = setupInvocation(endpoint, sepInv, invContext);
InvocationHandler invHandler = endpoint.getInvocationHandler();
- invHandler.invoke(endpoint, inv);
+ invHandler.invoke(endpoint, null, inv);
}
finally
{
Modified: trunk/testsuite/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/testsuite/ant-import/build-jars-jaxws.xml 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/testsuite/ant-import/build-jars-jaxws.xml 2007-05-18 21:40:57 UTC (rev 3145)
@@ -39,7 +39,7 @@
</jar>
<jar jarfile="${tests.output.dir}/libs/jaxws-eardeployment.ear">
<fileset dir="${tests.output.dir}/libs">
- <!--include name="jaxws-eardeployment.jar"/-->
+ <include name="jaxws-eardeployment.jar"/>
<include name="jaxws-eardeployment.war"/>
</fileset>
<metainf dir="${tests.output.dir}/resources/jaxws/eardeployment/META-INF">
Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2007-05-18 19:01:11 UTC (rev 3144)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2007-05-18 21:40:57 UTC (rev 3145)
@@ -45,7 +45,7 @@
return JBossWSTestSetup.newTestSetup(EarTestCase.class, earName);
}
- public void _testEJB3Endpoint() throws Exception
+ public void testEJB3Endpoint() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/earejb3/EJB3Bean?wsdl");
QName serviceName = new QName("http://eardeployment.jaxws.ws.test.jboss.org/", "TestEndpointService");
More information about the jbossws-commits
mailing list