Author: thomas.diesler(a)jboss.com
Date: 2007-06-25 09:57:36 -0400 (Mon, 25 Jun 2007)
New Revision: 3712
Modified:
branches/jbossws-2.0/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/InvocationHandlerEJB3.java
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdapterEJB3.java
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java
branches/jbossws-2.0/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java
branches/jbossws-2.0/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java
branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml
branches/jbossws-2.0/integration/spi/.classpath
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointHandlerDeployer.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointNameDeployer.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicEndpointInvocation.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandlerJSE.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/metadata/j2ee/UnifiedBeanMetaData.java
branches/jbossws-2.0/jbossws-core/.classpath
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java
branches/jbossws-2.0/jbossws-core/src/test/resources/test-excludes-jboss42.txt
Log:
Restore MDB endpoint invocations - more to come
Modified:
branches/jbossws-2.0/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/InvocationHandlerEJB3.java
===================================================================
---
branches/jbossws-2.0/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/InvocationHandlerEJB3.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/InvocationHandlerEJB3.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -70,7 +70,7 @@
throw new WebServiceException("Cannot find service endpoint target: "
+ objectName);
}
- public void invoke(Endpoint ep, Object beanInstance, Invocation epInv) throws
Exception
+ public void invoke(Endpoint ep, Invocation epInv) throws Exception
{
try
{
Modified:
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdapterEJB3.java
===================================================================
---
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdapterEJB3.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ApplicationMetaDataAdapterEJB3.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -39,6 +39,7 @@
import org.jboss.wsf.spi.deployment.WSDeploymentException;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedSessionMetaData;
/**
* Build container independent application meta data
@@ -61,10 +62,10 @@
if (container instanceof StatelessContainer)
{
StatelessContainer slc = (StatelessContainer)container;
- UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
- uslc.setEjbName(slc.getEjbName());
- uslc.setEjbClass(slc.getBeanClassName());
- beans.add(uslc);
+ UnifiedBeanMetaData usmd = new UnifiedSessionMetaData();
+ usmd.setEjbName(slc.getEjbName());
+ usmd.setEjbClass(slc.getBeanClassName());
+ beans.add(usmd);
}
}
Modified:
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java
===================================================================
---
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -52,7 +52,7 @@
import org.jboss.wsf.spi.utils.ObjectNameFactory;
/**
- * Handles invocations on EJB3 endpoints.
+ * Handles invocations on EJB21 endpoints.
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Apr-2007
@@ -119,7 +119,7 @@
}
- public void invoke(Endpoint ep, Object beanInstance, Invocation inv) throws Exception
+ public void invoke(Endpoint ep, Invocation inv) throws Exception
{
log.debug("Invoke: " + inv.getJavaMethod().getName());
Modified:
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java
===================================================================
---
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -78,7 +78,7 @@
throw new WebServiceException("Cannot find service endpoint target: "
+ objectName);
}
- public void invoke(Endpoint ep, Object beanInstance, Invocation epInv) throws
Exception
+ public void invoke(Endpoint ep, Invocation epInv) throws Exception
{
try
{
Modified:
branches/jbossws-2.0/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java
===================================================================
---
branches/jbossws-2.0/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -121,7 +121,7 @@
}
- public void invoke(Endpoint ep, Object beanInstance, Invocation inv) throws Exception
+ public void invoke(Endpoint ep, Invocation inv) throws Exception
{
log.debug("Invoke: " + inv.getJavaMethod().getName());
Modified:
branches/jbossws-2.0/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java
===================================================================
---
branches/jbossws-2.0/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -76,7 +76,7 @@
throw new WebServiceException("Cannot find service endpoint target: "
+ objectName);
}
- public void invoke(Endpoint ep, Object beanInstance, Invocation wsInv) throws
Exception
+ public void invoke(Endpoint ep, Invocation wsInv) throws Exception
{
try
{
Modified:
branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
---
branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -42,7 +42,6 @@
import javax.servlet.http.HttpServletResponse;
import javax.xml.namespace.QName;
import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.soap.SOAPFaultException;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
@@ -186,7 +185,7 @@
}
}
- public void handleRequest(Endpoint endpoint, InputStream inStream, OutputStream
outStream, InvocationContext context)
+ public void handleRequest(Endpoint endpoint, InputStream inStream, OutputStream
outStream, InvocationContext invContext)
{
log.debug("handleRequest: " + endpoint.getName());
@@ -201,20 +200,22 @@
if (type == EndpointMetaData.Type.JAXRPC)
{
msgContext = new SOAPMessageContextJAXRPC();
+ invContext.addAttachment(javax.xml.rpc.handler.MessageContext.class,
msgContext);
}
else
{
msgContext = new SOAPMessageContextJAXWS();
msgContext.put(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new
Boolean(false));
msgContext.put(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new
HashMap<String, DataHandler>());
+ invContext.addAttachment(javax.xml.ws.handler.MessageContext.class,
msgContext);
}
// Set servlet specific properties
HttpServletResponse httpResponse = null;
ServletHeaderSource headerSource = null;
- if (context instanceof ServletRequestContext)
+ if (invContext instanceof ServletRequestContext)
{
- ServletRequestContext reqContext = (ServletRequestContext)context;
+ ServletRequestContext reqContext = (ServletRequestContext)invContext;
ServletContext servletContext = reqContext.getServletContext();
HttpServletRequest httpRequest = reqContext.getHttpServletRequest();
@@ -245,7 +246,7 @@
try
{
- MessageAbstraction resMessage = processRequest(endpoint, headerSource, context,
inStream);
+ MessageAbstraction resMessage = processRequest(endpoint, headerSource,
invContext, inStream);
// Replace the message context with the response context
msgContext = MessageContextAssociation.peekMessageContext();
@@ -278,7 +279,8 @@
}
}
- sendResponse(outStream, msgContext, isFault);
+ if (outStream != null)
+ sendResponse(outStream, msgContext, isFault);
}
catch (Exception ex)
{
Modified:
branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java
===================================================================
---
branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -39,30 +39,30 @@
*/
public class ServiceLifecycleInvocationHandler extends InvocationHandlerJSE
{
- public void invoke(Endpoint ep, Object beanInstance, Invocation epInv) throws
Exception
+ @Override
+ public void invoke(Endpoint ep, Invocation epInv) throws Exception
{
try
{
- if (beanInstance == null)
- beanInstance = super.getBeanInstance(ep);
+ Object targetBean = getTargetBean(ep, epInv);
InvocationContext invContext = epInv.getInvocationContext();
- if (beanInstance instanceof ServiceLifecycle)
+ if (targetBean instanceof ServiceLifecycle)
{
ServletEndpointContext sepContext =
invContext.getAttachment(ServletEndpointContext.class);
if (sepContext != null)
- ((ServiceLifecycle)beanInstance).init(sepContext);
+ ((ServiceLifecycle)targetBean).init(sepContext);
}
try
{
- super.invoke(ep, beanInstance, epInv);
+ super.invoke(ep, epInv);
}
finally
{
- if (beanInstance instanceof ServiceLifecycle)
+ if (targetBean instanceof ServiceLifecycle)
{
- ((ServiceLifecycle)beanInstance).destroy();
+ ((ServiceLifecycle)targetBean).destroy();
}
}
}
Modified:
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml
===================================================================
---
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml 2007-06-25
13:57:36 UTC (rev 3712)
@@ -130,6 +130,7 @@
<map keyClass="java.lang.String"
valueClass="java.lang.String">
<entry><key>JAXRPC_JSE</key><value>org.jboss.wsf.stack.jbws.ServiceLifecycleInvocationHandler</value></entry>
<entry><key>JAXRPC_EJB21</key><value>org.jboss.wsf.container.jboss42.InvocationHandlerEJB21</value></entry>
+
<entry><key>JAXRPC_MDB21</key><value>org.jboss.wsf.container.jboss42.InvocationHandlerMDB21</value></entry>
<entry><key>JAXWS_JSE</key><value>org.jboss.wsf.stack.jbws.ServiceLifecycleInvocationHandler</value></entry>
</map>
</property>
Modified:
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
---
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-25
13:57:36 UTC (rev 3712)
@@ -130,6 +130,7 @@
<map keyClass="java.lang.String"
valueClass="java.lang.String">
<entry><key>JAXRPC_JSE</key><value>org.jboss.wsf.stack.jbws.ServiceLifecycleInvocationHandler</value></entry>
<entry><key>JAXRPC_EJB21</key><value>org.jboss.wsf.container.jboss42.InvocationHandlerEJB21</value></entry>
+
<entry><key>JAXRPC_MDB21</key><value>org.jboss.wsf.container.jboss42.InvocationHandlerMDB21</value></entry>
<entry><key>JAXWS_JSE</key><value>org.jboss.wsf.stack.jbws.ServiceLifecycleInvocationHandler</value></entry>
<entry><key>JAXWS_EJB3</key><value>org.jboss.wsf.container.jboss40.InvocationHandlerEJB3</value></entry>
</map>
Modified:
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
---
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-25
13:57:36 UTC (rev 3712)
@@ -134,6 +134,7 @@
<map keyClass="java.lang.String"
valueClass="java.lang.String">
<entry><key>JAXRPC_JSE</key><value>org.jboss.wsf.stack.jbws.ServiceLifecycleInvocationHandler</value></entry>
<entry><key>JAXRPC_EJB21</key><value>org.jboss.wsf.container.jboss42.InvocationHandlerEJB21</value></entry>
+
<entry><key>JAXRPC_MDB21</key><value>org.jboss.wsf.container.jboss42.InvocationHandlerMDB21</value></entry>
<entry><key>JAXWS_JSE</key><value>org.jboss.wsf.stack.jbws.ServiceLifecycleInvocationHandler</value></entry>
<entry><key>JAXWS_EJB3</key><value>org.jboss.wsf.container.jboss42.InvocationHandlerEJB3</value></entry>
</map>
Modified: branches/jbossws-2.0/integration/spi/.classpath
===================================================================
--- branches/jbossws-2.0/integration/spi/.classpath 2007-06-25 11:33:22 UTC (rev 3711)
+++ branches/jbossws-2.0/integration/spi/.classpath 2007-06-25 13:57:36 UTC (rev 3712)
@@ -21,5 +21,6 @@
<classpathentry kind="lib" path="thirdparty/dom4j.jar"/>
<classpathentry kind="lib" path="thirdparty/ant.jar"/>
<classpathentry kind="lib" path="thirdparty/getopt.jar"/>
+ <classpathentry kind="lib" path="thirdparty/saaj-api.jar"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointHandlerDeployer.java
===================================================================
---
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointHandlerDeployer.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointHandlerDeployer.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -27,6 +27,9 @@
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedMessageDrivenMetaData;
/**
* A deployer that assigns the handlers to the Endpoint
@@ -62,7 +65,7 @@
{
ep.setRequestHandler(getRequestHandler(dep));
ep.setLifecycleHandler(getLifecycleHandler(dep));
- ep.setInvocationHandler(getInvocationHandler(dep));
+ ep.setInvocationHandler(getInvocationHandler(ep));
}
}
@@ -92,11 +95,25 @@
}
}
- private InvocationHandler getInvocationHandler(Deployment dep)
+ private InvocationHandler getInvocationHandler(Endpoint ep)
{
- String className = invocationHandler.get(dep.getType().toString());
+ Deployment dep = ep.getService().getDeployment();
+ String key = dep.getType().toString();
+
+ // Use a special key for MDB endpoints
+ UnifiedApplicationMetaData uapp =
dep.getContext().getAttachment(UnifiedApplicationMetaData.class);
+ if (uapp != null)
+ {
+ UnifiedBeanMetaData bmd = uapp.getBeanByEjbName(ep.getShortName());
+ if (bmd instanceof UnifiedMessageDrivenMetaData)
+ {
+ key = "JAXRPC_MDB21";
+ }
+ }
+
+ String className = invocationHandler.get(key);
if (className == null)
- throw new IllegalStateException("Cannot obtain invocation handler for:
" + dep.getType());
+ throw new IllegalStateException("Cannot obtain invocation handler for:
" + key);
try
{
Modified:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointNameDeployer.java
===================================================================
---
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointNameDeployer.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointNameDeployer.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -23,6 +23,9 @@
//$Id$
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedMessageDrivenMetaData;
import org.jboss.wsf.spi.utils.ObjectNameFactory;
/**
@@ -46,6 +49,18 @@
name.append(Endpoint.SEPID_PROPERTY_CONTEXT + "=" +
contextRoot.substring(1) + ",");
name.append(Endpoint.SEPID_PROPERTY_ENDPOINT + "=" +
ep.getShortName());
+ // Append the JMS destination, for an MDB endpoint
+ UnifiedApplicationMetaData uapp =
dep.getContext().getAttachment(UnifiedApplicationMetaData.class);
+ if (uapp != null)
+ {
+ UnifiedBeanMetaData bmd = uapp.getBeanByEjbName(ep.getShortName());
+ if (bmd instanceof UnifiedMessageDrivenMetaData)
+ {
+ String destName =
((UnifiedMessageDrivenMetaData)bmd).getDestinationJndiName();
+ name.append(",jms=" + destName);
+ }
+ }
+
ep.setName(ObjectNameFactory.create(name.toString()));
}
}
Modified:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicEndpointInvocation.java
===================================================================
---
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicEndpointInvocation.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicEndpointInvocation.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -34,6 +34,7 @@
public class BasicEndpointInvocation implements Invocation
{
private InvocationContext invocationContext;
+ private Object targetBean;
private Method javaMethod;
private Object[] args;
private Object returnValue;
@@ -53,6 +54,16 @@
this.invocationContext = invocationContext;
}
+ public Object getTargetBean()
+ {
+ return targetBean;
+ }
+
+ public void setTargetBean(Object targetBean)
+ {
+ this.targetBean = targetBean;
+ }
+
public Method getJavaMethod()
{
return javaMethod;
Modified:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java
===================================================================
---
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -37,6 +37,10 @@
void setInvocationContext(InvocationContext context);
+ Object getTargetBean();
+
+ void setTargetBean(Object targetBean);
+
Method getJavaMethod();
void setJavaMethod(Method method);
Modified:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java
===================================================================
---
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -43,7 +43,7 @@
void start(Endpoint ep);
/** Invoke the the service endpoint */
- void invoke(Endpoint ep, Object beanInstance, Invocation inv) throws Exception;
+ void invoke(Endpoint ep, Invocation inv) throws Exception;
/** Stop the invocation handler */
void stop(Endpoint ep);
Modified:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandlerJSE.java
===================================================================
---
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandlerJSE.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandlerJSE.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -37,29 +37,40 @@
*/
public class InvocationHandlerJSE extends AbstractInvocationHandler
{
- protected Object getBeanInstance(Endpoint ep) throws InstantiationException,
IllegalAccessException
+ protected Object getTargetBean(Endpoint ep, Invocation epInv)
{
- Class epImpl = ep.getTargetBeanClass();
- Object targetBean = epImpl.newInstance();
+ Object targetBean = epInv.getTargetBean();
+ if (targetBean == null)
+ {
+ try
+ {
+ Class epImpl = ep.getTargetBeanClass();
+ targetBean = epImpl.newInstance();
+ epInv.setTargetBean(targetBean);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Canot get target bean instance",
ex);
+ }
+ }
return targetBean;
}
-
- public void invoke(Endpoint ep, Object beanInstance, Invocation epInv) throws
Exception
+
+ public void invoke(Endpoint ep, Invocation epInv) throws Exception
{
try
{
- if (beanInstance == null)
- beanInstance = getBeanInstance(ep);
+ Object targetBean = getTargetBean(ep, epInv);
InvocationContext invContext = epInv.getInvocationContext();
WebServiceContext wsContext =
invContext.getAttachment(WebServiceContext.class);
if (wsContext != null)
{
- new WebServiceContextInjector().injectContext(beanInstance,
(WebServiceContext)wsContext);
+ new WebServiceContextInjector().injectContext(targetBean,
(WebServiceContext)wsContext);
}
- Method method = getImplMethod(beanInstance.getClass(), epInv.getJavaMethod());
- Object retObj = method.invoke(beanInstance, epInv.getArgs());
+ Method method = getImplMethod(targetBean.getClass(), epInv.getJavaMethod());
+ Object retObj = method.invoke(targetBean, epInv.getArgs());
epInv.setReturnValue(retObj);
}
catch (Exception e)
Modified:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/metadata/j2ee/UnifiedBeanMetaData.java
===================================================================
---
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/metadata/j2ee/UnifiedBeanMetaData.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/metadata/j2ee/UnifiedBeanMetaData.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -29,7 +29,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 05-May-2006
*/
-public class UnifiedBeanMetaData
+public abstract class UnifiedBeanMetaData
{
/** The ejb-name element specifies an enterprise bean's name. */
private String ejbName;
Modified: branches/jbossws-2.0/jbossws-core/.classpath
===================================================================
--- branches/jbossws-2.0/jbossws-core/.classpath 2007-06-25 11:33:22 UTC (rev 3711)
+++ branches/jbossws-2.0/jbossws-core/.classpath 2007-06-25 13:57:36 UTC (rev 3712)
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src"
path="output/tests/wsconsume/java"/>
- <classpathentry excluding="org/jboss/test/ws/jaxrpc/samples/jmstransport/"
kind="src" path="src/test/java"/>
+ <classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="thirdparty/activation.jar"/>
<classpathentry kind="lib" path="thirdparty/getopt.jar"/>
Modified:
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
---
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -200,7 +200,7 @@
// Invoke an instance of the SEI implementation bean
Invocation inv = setupInvocation(endpoint, sepInv, invContext);
InvocationHandler invHandler = endpoint.getInvocationHandler();
- invHandler.invoke(endpoint, null, inv);
+ invHandler.invoke(endpoint, inv);
// Handler processing might have replaced the endpoint invocation
sepInv =
inv.getInvocationContext().getAttachment(EndpointInvocation.class);
Modified:
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
===================================================================
---
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -37,13 +37,7 @@
*/
public class ThreadLocalAssociation
{
-
/**
- * Handles invocations on MDB endpoints.
- */
- private static ThreadLocal invokerMDBAssoc = new ThreadLocal();
-
- /**
* SOAP message context
* @see org.jboss.ws.core.soap.MessageContextAssociation
*/
@@ -54,11 +48,6 @@
*/
private static ThreadLocal<SecurityStore> strTransformAssoc = new
ThreadLocal<SecurityStore>();
- public static ThreadLocal localInvokerMDBAssoc()
- {
- return invokerMDBAssoc;
- }
-
public static ThreadLocal<Stack<CommonMessageContext>>
localMsgContextAssoc()
{
return msgContextAssoc;
@@ -71,7 +60,6 @@
public static void clear()
{
- invokerMDBAssoc.set(null);
msgContextAssoc.set(null);
strTransformAssoc.set(null);
}
Modified:
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java
===================================================================
---
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -20,11 +20,12 @@
import javax.jms.TextMessage;
import javax.naming.InitialContext;
+import org.jboss.wsf.spi.test.JBossWSTest;
+import org.jboss.wsf.spi.test.JBossWSTestSetup;
+import org.jboss.wsf.spi.utils.DOMUtils;
+
import junit.framework.Test;
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.utils.DOMUtils;
/**
* A web service client that connects to a MDB endpoint.
Modified:
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java
===================================================================
---
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.java 2007-06-25
13:57:36 UTC (rev 3712)
@@ -11,7 +11,7 @@
import java.rmi.RemoteException;
import org.jboss.logging.Logger;
-import org.jboss.ws.integration.jboss42.jms.JMSTransportSupport;
+import org.jboss.wsf.spi.transport.jms.JMSTransportSupport;
/**
* An example of a MDB acting as a web service endpoint.
Modified: branches/jbossws-2.0/jbossws-core/src/test/resources/test-excludes-jboss42.txt
===================================================================
---
branches/jbossws-2.0/jbossws-core/src/test/resources/test-excludes-jboss42.txt 2007-06-25
11:33:22 UTC (rev 3711)
+++
branches/jbossws-2.0/jbossws-core/src/test/resources/test-excludes-jboss42.txt 2007-06-25
13:57:36 UTC (rev 3712)
@@ -9,6 +9,3 @@
org/jboss/test/ws/jaxws/samples/retail/**
org/jboss/test/ws/jaxws/samples/webserviceref/**
org/jboss/test/ws/jaxws/serviceref/**
-
-org/jboss/test/ws/jaxrpc/samples/jmstransport/JMSTransportTestCase.*
-org/jboss/test/ws/jaxrpc/samples/jmstransport/OrganizationJMSEndpoint.*