Author: richard.opalka(a)jboss.com
Date: 2011-06-20 10:14:56 -0400 (Mon, 20 Jun 2011)
New Revision: 14587
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextFactoryImpl.java
Log:
[JBWS-3318] WebServiceContext is invocation type agnostic since now
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2011-06-20
14:10:26 UTC (rev 14586)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2011-06-20
14:14:56 UTC (rev 14587)
@@ -324,11 +324,11 @@
if (msgContext instanceof SOAPMessageContextJAXWS)
{
final DeploymentType deploymentType = ep.getService().getDeployment().getType();
- if (DeploymentType.JAXWS_JSE == deploymentType)
+ if ((DeploymentType.JAXWS_JSE == deploymentType) || (DeploymentType.JAXWS_EJB3
== deploymentType))
{
if (msgContext.get(MessageContext.SERVLET_REQUEST) != null)
{
- WebServiceContext wsContext =
contextFactory.newWebServiceContext(InvocationType.JAXWS_JSE,
(SOAPMessageContextJAXWS)msgContext);
+ WebServiceContext wsContext =
contextFactory.newWebServiceContext((SOAPMessageContextJAXWS)msgContext);
invContext.addAttachment(WebServiceContext.class, wsContext);
}
else
@@ -336,11 +336,6 @@
log.warn("Cannot provide WebServiceContext, since the current
MessageContext does not provide a ServletRequest");
}
}
- else if (DeploymentType.JAXWS_EJB3 == deploymentType)
- {
- WebServiceContext wsContext =
contextFactory.newWebServiceContext(InvocationType.JAXWS_EJB3,
(SOAPMessageContextJAXWS)msgContext);
- invContext.addAttachment(WebServiceContext.class, wsContext);
- }
invContext.addAttachment(javax.xml.ws.handler.MessageContext.class,
msgContext);
}
if (msgContext instanceof SOAPMessageContextJAXRPC)
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextFactoryImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextFactoryImpl.java 2011-06-20
14:10:26 UTC (rev 14586)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextFactoryImpl.java 2011-06-20
14:14:56 UTC (rev 14587)
@@ -23,28 +23,21 @@
import javax.xml.ws.handler.MessageContext;
-import org.jboss.ws.common.invocation.WebServiceContextEJB;
-import org.jboss.ws.common.invocation.WebServiceContextJSE;
+import org.jboss.ws.common.invocation.WebServiceContextAdapter;
import org.jboss.wsf.spi.invocation.ExtensibleWebServiceContext;
-import org.jboss.wsf.spi.invocation.InvocationType;
import org.jboss.wsf.spi.invocation.WebServiceContextFactory;
/**
+ * Web service context factory implementation.
*
* @author alessio.soldano(a)jboss.com
- *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
-public class WebServiceContextFactoryImpl extends WebServiceContextFactory
+public final class WebServiceContextFactoryImpl extends WebServiceContextFactory
{
- public ExtensibleWebServiceContext newWebServiceContext(InvocationType type,
MessageContext messageContext)
+ @Override
+ public ExtensibleWebServiceContext newWebServiceContext(MessageContext
messageContext)
{
- ExtensibleWebServiceContext context = null;
-
- if(type.toString().indexOf("EJB")!=-1 ||
type.toString().indexOf("MDB")!=-1)
- context = new WebServiceContextEJB(new
NativeWebServiceContext(messageContext));
- else
- context = new WebServiceContextJSE(new
NativeWebServiceContext(messageContext));
-
- return context;
+ return new WebServiceContextAdapter(new NativeWebServiceContext(messageContext));
}
}
Show replies by date