Author: thomas.diesler(a)jboss.com
Date: 2007-05-22 09:40:41 -0400 (Tue, 22 May 2007)
New Revision: 3185
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
Removed:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/EndpointInvocation.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/ServiceEndpointInvocation.java
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ServiceEndpointInterceptor.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ServiceEndpointInterceptor.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicEndpointInvocation.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicInvocationHandler.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandlerJSE.java
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerEJB3.java
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerJSE.java
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerEJB3.java
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerJSE.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonBinding.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java
trunk/jbossws-core/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
Log:
Revert back to EndpointInvocation
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -35,7 +35,6 @@
import org.jboss.ejb.EjbModule;
import org.jboss.ejb.Interceptor;
import org.jboss.ejb.StatelessSessionContainer;
-import org.jboss.invocation.Invocation;
import org.jboss.invocation.InvocationKey;
import org.jboss.invocation.InvocationType;
import org.jboss.invocation.PayloadKey;
@@ -45,8 +44,8 @@
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
import org.jboss.wsf.spi.invocation.AbstractInvocationHandler;
-import org.jboss.wsf.spi.invocation.EndpointInvocation;
import org.jboss.wsf.spi.invocation.HandlerCallback;
+import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.wsf.spi.utils.ObjectNameFactory;
@@ -123,9 +122,9 @@
}
- public void invoke(Endpoint ep, Object beanInstance,
org.jboss.wsf.spi.invocation.EndpointInvocation epInv) throws Exception
+ public void invoke(Endpoint ep, Object beanInstance, Invocation inv) throws Exception
{
- log.debug("Invoke: " + epInv.getJavaMethod().getName());
+ log.debug("Invoke: " + inv.getJavaMethod().getName());
// these are provided by the ServerLoginHandler
Principal principal = SecurityAssociation.getPrincipal();
@@ -135,28 +134,28 @@
try
{
// setup the invocation
- Method method = epInv.getJavaMethod();
- Object[] args = epInv.getArgs();
- Invocation inv = new Invocation(null, method, args, null, principal,
credential);
+ Method method = inv.getJavaMethod();
+ Object[] args = inv.getArgs();
+ org.jboss.invocation.Invocation jbInv = new
org.jboss.invocation.Invocation(null, method, args, null, principal, credential);
// EJB2.1 endpoints will only get an JAXRPC context
- MessageContext msgContext =
epInv.getInvocationContext().getAttachment(MessageContext.class);
+ MessageContext msgContext =
inv.getInvocationContext().getAttachment(MessageContext.class);
if (msgContext == null)
throw new IllegalStateException("Cannot obtain MessageContext");
- HandlerCallback callback =
epInv.getInvocationContext().getAttachment(HandlerCallback.class);
+ HandlerCallback callback =
inv.getInvocationContext().getAttachment(HandlerCallback.class);
if (callback == null)
throw new IllegalStateException("Cannot obtain HandlerCallback");
- inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
- inv.setValue(InvocationKey.SOAP_MESSAGE,
((SOAPMessageContext)msgContext).getMessage());
- inv.setType(InvocationType.SERVICE_ENDPOINT);
- inv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT);
- inv.setValue(EndpointInvocation.class.getName(), epInv, PayloadKey.TRANSIENT);
+ jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
+ jbInv.setValue(InvocationKey.SOAP_MESSAGE,
((SOAPMessageContext)msgContext).getMessage());
+ jbInv.setType(InvocationType.SERVICE_ENDPOINT);
+ jbInv.setValue(HandlerCallback.class.getName(), callback,
PayloadKey.TRANSIENT);
+ jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT);
String[] sig = { org.jboss.invocation.Invocation.class.getName() };
- Object retObj = server.invoke(objectName, "invoke", new Object[] { inv
}, sig);
- epInv.setReturnValue(retObj);
+ Object retObj = server.invoke(objectName, "invoke", new Object[] {
jbInv }, sig);
+ inv.setReturnValue(retObj);
}
catch (Exception e)
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB3.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -40,7 +40,7 @@
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
import org.jboss.wsf.spi.invocation.AbstractInvocationHandler;
-import org.jboss.wsf.spi.invocation.EndpointInvocation;
+import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.WebServiceContextEJB;
import org.jboss.wsf.spi.utils.ObjectNameFactory;
@@ -81,7 +81,7 @@
throw new WebServiceException("Cannot find service endpoint target: "
+ objectName);
}
- public void invoke(Endpoint ep, Object beanInstance, EndpointInvocation epInv) throws
Exception
+ public void invoke(Endpoint ep, Object beanInstance, Invocation epInv) throws
Exception
{
try
{
@@ -113,7 +113,7 @@
private javax.xml.ws.handler.MessageContext jaxwsMessageContext;
private javax.xml.rpc.handler.MessageContext jaxrpcMessageContext;
- public CallbackImpl(EndpointInvocation epInv)
+ public CallbackImpl(Invocation epInv)
{
jaxrpcMessageContext =
epInv.getInvocationContext().getAttachment(javax.xml.rpc.handler.MessageContext.class);
jaxwsMessageContext =
epInv.getInvocationContext().getAttachment(javax.xml.ws.handler.MessageContext.class);
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ServiceEndpointInterceptor.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ServiceEndpointInterceptor.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/ServiceEndpointInterceptor.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -60,8 +60,8 @@
}
// Get the endpoint invocation
- org.jboss.wsf.spi.invocation.EndpointInvocation epInv =
(org.jboss.wsf.spi.invocation.EndpointInvocation)mi
- .getValue(org.jboss.wsf.spi.invocation.EndpointInvocation.class.getName());
+ org.jboss.wsf.spi.invocation.Invocation epInv =
(org.jboss.wsf.spi.invocation.Invocation)mi
+ .getValue(org.jboss.wsf.spi.invocation.Invocation.class.getName());
// Get the handler callback
HandlerCallback callback =
(HandlerCallback)mi.getValue(HandlerCallback.class.getName());
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -35,7 +35,6 @@
import org.jboss.ejb.EjbModule;
import org.jboss.ejb.Interceptor;
import org.jboss.ejb.StatelessSessionContainer;
-import org.jboss.invocation.Invocation;
import org.jboss.invocation.InvocationKey;
import org.jboss.invocation.InvocationType;
import org.jboss.invocation.PayloadKey;
@@ -45,8 +44,8 @@
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
import org.jboss.wsf.spi.invocation.AbstractInvocationHandler;
-import org.jboss.wsf.spi.invocation.EndpointInvocation;
import org.jboss.wsf.spi.invocation.HandlerCallback;
+import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.wsf.spi.utils.ObjectNameFactory;
@@ -123,9 +122,9 @@
}
- public void invoke(Endpoint ep, Object beanInstance, EndpointInvocation epInv) throws
Exception
+ public void invoke(Endpoint ep, Object beanInstance, Invocation inv) throws Exception
{
- log.debug("Invoke: " + epInv.getJavaMethod().getName());
+ log.debug("Invoke: " + inv.getJavaMethod().getName());
// these are provided by the ServerLoginHandler
Principal principal = SecurityAssociation.getPrincipal();
@@ -135,28 +134,28 @@
try
{
// setup the invocation
- Method method = epInv.getJavaMethod();
- Object[] args = epInv.getArgs();
- Invocation inv = new Invocation(null, method, args, null, principal,
credential);
+ Method method = inv.getJavaMethod();
+ Object[] args = inv.getArgs();
+ org.jboss.invocation.Invocation jbInv = new
org.jboss.invocation.Invocation(null, method, args, null, principal, credential);
// EJB2.1 endpoints will only get an JAXRPC context
- MessageContext msgContext =
epInv.getInvocationContext().getAttachment(MessageContext.class);
+ MessageContext msgContext =
inv.getInvocationContext().getAttachment(MessageContext.class);
if (msgContext == null)
throw new IllegalStateException("Cannot obtain MessageContext");
- HandlerCallback callback =
epInv.getInvocationContext().getAttachment(HandlerCallback.class);
+ HandlerCallback callback =
inv.getInvocationContext().getAttachment(HandlerCallback.class);
if (callback == null)
throw new IllegalStateException("Cannot obtain HandlerCallback");
- inv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
- inv.setValue(InvocationKey.SOAP_MESSAGE,
((SOAPMessageContext)msgContext).getMessage());
- inv.setType(InvocationType.SERVICE_ENDPOINT);
- inv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT);
- inv.setValue(EndpointInvocation.class.getName(), epInv, PayloadKey.TRANSIENT);
+ jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
+ jbInv.setValue(InvocationKey.SOAP_MESSAGE,
((SOAPMessageContext)msgContext).getMessage());
+ jbInv.setType(InvocationType.SERVICE_ENDPOINT);
+ jbInv.setValue(HandlerCallback.class.getName(), callback,
PayloadKey.TRANSIENT);
+ jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT);
String[] sig = { org.jboss.invocation.Invocation.class.getName() };
- Object retObj = server.invoke(objectName, "invoke", new Object[] { inv
}, sig);
- epInv.setReturnValue(retObj);
+ Object retObj = server.invoke(objectName, "invoke", new Object[] {
jbInv }, sig);
+ inv.setReturnValue(retObj);
}
catch (Exception e)
{
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -40,7 +40,7 @@
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
import org.jboss.wsf.spi.invocation.AbstractInvocationHandler;
-import org.jboss.wsf.spi.invocation.EndpointInvocation;
+import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.WebServiceContextEJB;
import org.jboss.wsf.spi.utils.ObjectNameFactory;
@@ -79,7 +79,7 @@
throw new WebServiceException("Cannot find service endpoint target: "
+ objectName);
}
- public void invoke(Endpoint ep, Object beanInstance, EndpointInvocation epInv) throws
Exception
+ public void invoke(Endpoint ep, Object beanInstance, Invocation epInv) throws
Exception
{
try
{
@@ -111,7 +111,7 @@
private javax.xml.ws.handler.MessageContext jaxwsMessageContext;
private javax.xml.rpc.handler.MessageContext jaxrpcMessageContext;
- public CallbackImpl(EndpointInvocation epInv)
+ public CallbackImpl(Invocation epInv)
{
jaxrpcMessageContext =
epInv.getInvocationContext().getAttachment(javax.xml.rpc.handler.MessageContext.class);
jaxwsMessageContext =
epInv.getInvocationContext().getAttachment(javax.xml.ws.handler.MessageContext.class);
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ServiceEndpointInterceptor.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ServiceEndpointInterceptor.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/ServiceEndpointInterceptor.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -60,8 +60,8 @@
}
// Get the endpoint invocation
- org.jboss.wsf.spi.invocation.EndpointInvocation epInv =
(org.jboss.wsf.spi.invocation.EndpointInvocation)mi
- .getValue(org.jboss.wsf.spi.invocation.EndpointInvocation.class.getName());
+ org.jboss.wsf.spi.invocation.Invocation epInv =
(org.jboss.wsf.spi.invocation.Invocation)mi
+ .getValue(org.jboss.wsf.spi.invocation.Invocation.class.getName());
// Get the handler callback
HandlerCallback callback =
(HandlerCallback)mi.getValue(HandlerCallback.class.getName());
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicEndpointInvocation.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicEndpointInvocation.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicEndpointInvocation.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -31,7 +31,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 20-Apr-2007
*/
-public class BasicEndpointInvocation implements EndpointInvocation
+public class BasicEndpointInvocation implements Invocation
{
private InvocationContext invocationContext;
private Method javaMethod;
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicInvocationHandler.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicInvocationHandler.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicInvocationHandler.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -33,7 +33,7 @@
*/
public abstract class BasicInvocationHandler implements InvocationHandler
{
- public EndpointInvocation createInvocation()
+ public Invocation createInvocation()
{
return new BasicEndpointInvocation();
}
Deleted:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/EndpointInvocation.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/EndpointInvocation.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/EndpointInvocation.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -1,51 +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.wsf.spi.invocation;
-
-import java.lang.reflect.Method;
-
-//$Id$
-
-/**
- * A general endpoint invocation.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public interface EndpointInvocation
-{
- InvocationContext getInvocationContext();
-
- void setInvocationContext(InvocationContext context);
-
- Method getJavaMethod();
-
- void setJavaMethod(Method method);
-
- Object[] getArgs();
-
- void setArgs(Object[] args);
-
- Object getReturnValue();
-
- void setReturnValue(Object ret);
-}
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java
(from rev 3182,
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/EndpointInvocation.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java
(rev 0)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.invocation;
+
+import java.lang.reflect.Method;
+
+//$Id$
+
+/**
+ * A general endpoint invocation.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface Invocation
+{
+ InvocationContext getInvocationContext();
+
+ void setInvocationContext(InvocationContext context);
+
+ Method getJavaMethod();
+
+ void setJavaMethod(Method method);
+
+ Object[] getArgs();
+
+ void setArgs(Object[] args);
+
+ Object getReturnValue();
+
+ void setReturnValue(Object ret);
+}
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -34,7 +34,7 @@
public interface InvocationHandler
{
/** Create the default invokation object */
- EndpointInvocation createInvocation();
+ Invocation createInvocation();
/** Create the invocation handler */
void create(Endpoint ep);
@@ -43,7 +43,7 @@
void start(Endpoint ep);
/** Invoke the the service endpoint */
- void invoke(Endpoint ep, Object beanInstance, EndpointInvocation inv) throws
Exception;
+ void invoke(Endpoint ep, Object beanInstance, Invocation inv) throws Exception;
/** Stop the invocation handler */
void stop(Endpoint ep);
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandlerJSE.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandlerJSE.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandlerJSE.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -44,7 +44,7 @@
return targetBean;
}
- public void invoke(Endpoint ep, Object beanInstance, EndpointInvocation epInv) throws
Exception
+ public void invoke(Endpoint ep, Object beanInstance, Invocation epInv) throws
Exception
{
try
{
Modified:
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerEJB3.java
===================================================================
---
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerEJB3.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerEJB3.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -31,7 +31,7 @@
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointAssociation;
-import org.jboss.wsf.spi.invocation.EndpointInvocation;
+import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import com.sun.istack.NotNull;
@@ -81,7 +81,7 @@
Endpoint ep = EndpointAssociation.getEndpoint();
InvocationHandler invHandler = ep.getInvocationHandler();
- EndpointInvocation inv = invHandler.createInvocation();
+ Invocation inv = invHandler.createInvocation();
inv.setJavaMethod(m);
inv.setArgs(args);
Modified: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerJSE.java
===================================================================
---
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerJSE.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/InvokerJSE.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -31,7 +31,7 @@
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointAssociation;
-import org.jboss.wsf.spi.invocation.EndpointInvocation;
+import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import com.sun.istack.NotNull;
@@ -84,7 +84,7 @@
Endpoint ep = EndpointAssociation.getEndpoint();
InvocationHandler invHandler = ep.getInvocationHandler();
- EndpointInvocation inv = invHandler.createInvocation();
+ Invocation inv = invHandler.createInvocation();
inv.setJavaMethod(m);
inv.setArgs(args);
Modified:
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerEJB3.java
===================================================================
---
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerEJB3.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerEJB3.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -31,7 +31,7 @@
import org.codehaus.xfire.service.invoker.Invoker;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointAssociation;
-import org.jboss.wsf.spi.invocation.EndpointInvocation;
+import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationHandler;
/**
@@ -47,7 +47,7 @@
Endpoint ep = EndpointAssociation.getEndpoint();
InvocationHandler invHandler = ep.getInvocationHandler();
- EndpointInvocation inv = invHandler.createInvocation();
+ Invocation inv = invHandler.createInvocation();
inv.getInvocationContext().addAttachment(MessageContext.class, context);
inv.setJavaMethod(m);
inv.setArgs(params);
Modified: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerJSE.java
===================================================================
---
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerJSE.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/InvokerJSE.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -31,7 +31,7 @@
import org.codehaus.xfire.service.invoker.Invoker;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointAssociation;
-import org.jboss.wsf.spi.invocation.EndpointInvocation;
+import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationHandler;
/**
@@ -47,7 +47,7 @@
Endpoint ep = EndpointAssociation.getEndpoint();
InvocationHandler invHandler = ep.getInvocationHandler();
- EndpointInvocation inv = invHandler.createInvocation();
+ Invocation inv = invHandler.createInvocation();
inv.getInvocationContext().addAttachment(MessageContext.class, context);
inv.setJavaMethod(m);
inv.setArgs(params);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonBinding.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonBinding.java 2007-05-22
13:25:27 UTC (rev 3184)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonBinding.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -40,16 +40,16 @@
public interface CommonBinding
{
/** On the client side, generate the Object from IN parameters. */
- MessageAbstraction bindRequestMessage(OperationMetaData opMetaData,
ServiceEndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws
BindingException;
+ MessageAbstraction bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation
epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException;
/** On the server side, extract the IN parameters from the Object and populate an
Invocation object */
- ServiceEndpointInvocation unbindRequestMessage(OperationMetaData opMetaData,
MessageAbstraction reqMessage) throws BindingException;
+ EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData,
MessageAbstraction reqMessage) throws BindingException;
/** On the server side, generate the Object from OUT parameters in the Invocation
object. */
- MessageAbstraction bindResponseMessage(OperationMetaData opMetaData,
ServiceEndpointInvocation epInv) throws BindingException;
+ MessageAbstraction bindResponseMessage(OperationMetaData opMetaData,
EndpointInvocation epInv) throws BindingException;
/** On the client side, extract the OUT parameters from the Object and return them to
the client. */
- void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction
resMessage, ServiceEndpointInvocation epInv, Map<QName, UnboundHeader>
unboundHeaders) throws BindingException;
+ void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction
resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
throws BindingException;
/** bind an exception to a fault message */
MessageAbstraction bindFaultMessage(Exception ex);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java 2007-05-22
13:25:27 UTC (rev 3184)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -81,7 +81,7 @@
// The current operation name
protected QName operationName;
// Output parameters
- protected ServiceEndpointInvocation epInv;
+ protected EndpointInvocation epInv;
// The binding provider
protected CommonBindingProvider bindingProvider;
// A Map<QName,UnboundHeader> of header entries
@@ -264,7 +264,7 @@
binding.setHeaderSource(this);
// Create the invocation and sync the input parameters
- epInv = new ServiceEndpointInvocation(opMetaData);
+ epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(inputParams);
// Set the required outbound properties
@@ -479,7 +479,7 @@
/** Synchronize the operation paramters with the call output parameters.
*/
- private Object syncOutputParams(Object[] inParams, ServiceEndpointInvocation epInv)
throws SOAPException
+ private Object syncOutputParams(Object[] inParams, EndpointInvocation epInv) throws
SOAPException
{
Object retValue = null;
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-05-22
13:25:27 UTC (rev 3184)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -134,7 +134,7 @@
protected abstract MessageAbstraction createMessage(OperationMetaData opMetaData)
throws SOAPException;
/** On the client side, generate the payload from IN parameters. */
- public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData,
ServiceEndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData,
EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
throws BindingException
{
if (log.isDebugEnabled())
@@ -255,7 +255,7 @@
public abstract void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage
reqMessage);
/** On the server side, extract the IN parameters from the payload and populate an
Invocation object */
- public ServiceEndpointInvocation unbindRequestMessage(OperationMetaData opMetaData,
MessageAbstraction payload) throws BindingException
+ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData,
MessageAbstraction payload) throws BindingException
{
if (log.isDebugEnabled())
log.debug("unbindRequestMessage: " + opMetaData.getQName());
@@ -272,7 +272,7 @@
verifySOAPVersion(opMetaData, soapEnvelope);
// Construct the endpoint invocation object
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
if (msgContext == null)
@@ -368,7 +368,7 @@
}
/** On the server side, generate the payload from OUT parameters. */
- public MessageAbstraction bindResponseMessage(OperationMetaData opMetaData,
ServiceEndpointInvocation epInv) throws BindingException
+ public MessageAbstraction bindResponseMessage(OperationMetaData opMetaData,
EndpointInvocation epInv) throws BindingException
{
if (log.isDebugEnabled())
log.debug("bindResponseMessage: " + opMetaData.getQName());
@@ -497,7 +497,7 @@
}
/** On the client side, extract the OUT parameters from the payload and return them to
the client. */
- public void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction
payload, ServiceEndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ public void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction
payload, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
throws BindingException
{
if (log.isDebugEnabled())
Copied: trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java (from
rev 3182,
trunk/jbossws-core/src/main/java/org/jboss/ws/core/ServiceEndpointInvocation.java)
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
(rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -0,0 +1,397 @@
+/*
+ * 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;
+
+// $Id$
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.SOAPException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.soap.SOAPContentElement;
+import org.jboss.ws.core.utils.HolderUtils;
+import org.jboss.ws.core.utils.MimeUtils;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+import org.jboss.wsf.spi.utils.JavaUtils;
+import org.w3c.dom.Element;
+
+/** A web service invocation.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-Oct-2004
+ */
+public class EndpointInvocation
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(EndpointInvocation.class);
+
+ // The operation meta data for this invocation
+ private OperationMetaData opMetaData;
+ // Map the named endpoint parameters
+ private Map<QName, Object> reqPayload = new LinkedHashMap<QName,
Object>();
+ // Map the named endpoint parameters
+ private Map<QName, Object> resPayload = new LinkedHashMap<QName,
Object>();
+ // The return value
+ private Object returnValue;
+ // Map of output parameters, key being the parameter index in the method signature
+ private Map<Integer, Object> outParameters = new HashMap<Integer,
Object>();
+
+ public EndpointInvocation(OperationMetaData opMetaData)
+ {
+ this.opMetaData = opMetaData;
+ }
+
+ public OperationMetaData getOperationMetaData()
+ {
+ return opMetaData;
+ }
+
+ public Method getJavaMethod()
+ {
+ return opMetaData.getJavaMethod();
+ }
+
+ public Map<Integer, Object> getOutParameters()
+ {
+ return outParameters;
+ }
+
+ public List<QName> getRequestParamNames()
+ {
+ List<QName> xmlNames = new ArrayList<QName>();
+ xmlNames.addAll(reqPayload.keySet());
+ return xmlNames;
+ }
+
+ public void setRequestParamValue(QName xmlName, Object value)
+ {
+ if (log.isDebugEnabled())
+ log.debug("setRequestParamValue: [name=" + xmlName +
",value=" + getTypeName(value) + "]");
+ reqPayload.put(xmlName, value);
+ }
+
+ public Object getRequestParamValue(QName xmlName)
+ {
+ if (log.isDebugEnabled())
+ log.debug("getRequestParamValue: " + xmlName);
+ Object paramValue = reqPayload.get(xmlName);
+ ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
+ try
+ {
+ paramValue = transformPayloadValue(paramMetaData, paramValue);
+ }
+ catch (SOAPException ex)
+ {
+ throw new WSException(ex);
+ }
+ return paramValue;
+ }
+
+ /** Returns the payload that can be passed on to the endpoint implementation
+ */
+ public Object[] getRequestPayload()
+ {
+ log.debug("getRequestPayload");
+ List<QName> xmlNames = getRequestParamNames();
+
+ Object[] payload = new
Object[opMetaData.getJavaMethod().getParameterTypes().length];
+ for (int i = 0; i < xmlNames.size(); i++)
+ {
+ QName xmlName = xmlNames.get(i);
+ Object paramValue = getRequestParamValue(xmlName);
+
+ ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
+ syncEndpointInputParam(paramMetaData, paramValue, payload);
+ }
+
+ return payload;
+ }
+
+ public List<QName> getResponseParamNames()
+ {
+ List<QName> xmlNames = new ArrayList<QName>();
+ xmlNames.addAll(resPayload.keySet());
+ return xmlNames;
+ }
+
+ public void setResponseParamValue(QName xmlName, Object value)
+ {
+ if (log.isDebugEnabled())
+ log.debug("setResponseParamValue: [name=" + xmlName +
",value=" + getTypeName(value) + "]");
+ resPayload.put(xmlName, value);
+ }
+
+ public Object getResponseParamValue(QName xmlName) throws SOAPException
+ {
+ if (log.isDebugEnabled())
+ log.debug("getResponseParamValue: " + xmlName);
+ Object paramValue = resPayload.get(xmlName);
+ ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
+ paramValue = transformPayloadValue(paramMetaData, paramValue);
+ if (paramValue != null)
+ {
+ Class valueType = paramValue.getClass();
+ if (HolderUtils.isHolderType(valueType))
+ {
+ paramValue = HolderUtils.getHolderValue(paramValue);
+ }
+ }
+ return paramValue;
+ }
+
+ public void setReturnValue(Object value)
+ {
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+ if (value != null && retMetaData == null)
+ throw new WSException("Operation does not have a return value: " +
opMetaData.getQName());
+
+ if (log.isDebugEnabled())
+ log.debug("setReturnValue: " + getTypeName(value));
+ this.returnValue = value;
+ }
+
+ public Object getReturnValue()
+ {
+ if (log.isDebugEnabled())
+ log.debug("getReturnValue");
+ Object paramValue = returnValue;
+ ParameterMetaData paramMetaData = opMetaData.getReturnParameter();
+ if (paramMetaData != null)
+ {
+ try
+ {
+ paramValue = transformPayloadValue(paramMetaData, paramValue);
+ }
+ catch (SOAPException ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+ return paramValue;
+ }
+
+ private Object transformPayloadValue(ParameterMetaData paramMetaData, final Object
paramValue) throws SOAPException
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ QName xmlType = paramMetaData.getXmlType();
+ Class<?> javaType = paramMetaData.getJavaType();
+ String javaName = paramMetaData.getJavaTypeName();
+
+ if (xmlType == null)
+ throw new IllegalStateException("Cannot obtain xml type for:
[xmlName=" + xmlName + ",javaName=" + javaName + "]");
+
+ Object retValue = paramValue;
+
+ // Handle attachment part
+ if (paramValue instanceof AttachmentPart)
+ {
+ AttachmentPart part = (AttachmentPart)paramValue;
+
+ Set mimeTypes = paramMetaData.getMimeTypes();
+ if (DataHandler.class.isAssignableFrom(javaType) &&
!javaType.equals(Object.class))
+ {
+ DataHandler handler = part.getDataHandler();
+ String mimeType = MimeUtils.getBaseMimeType(handler.getContentType());
+
+ // JAX-WS 2.0, 2.6.3.1 MIME Content
+ // Conformance (MIME type mismatch): On receipt of a message where the MIME
type of a part does not
+ // match that described in the WSDL an implementation SHOULD throw a
WebServiceException.
+ if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
+ log.warn("Mime type " + mimeType + " not allowed for
parameter " + xmlName + " allowed types are " + mimeTypes);
+
+ retValue = part.getDataHandler();
+ }
+ else
+ {
+ retValue = part.getContent();
+ String mimeType = MimeUtils.getBaseMimeType(part.getContentType());
+
+ if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
+ throw new SOAPException("Mime type " + mimeType + " not
allowed for parameter " + xmlName + " allowed types are " + mimeTypes);
+
+ if (retValue != null)
+ {
+ Class valueType = retValue.getClass();
+ if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
+ throw new SOAPException("javaType [" + javaType.getName() +
"] is not assignable from attachment content: " + valueType.getName());
+ }
+ }
+ }
+ else if (paramValue instanceof SOAPContentElement)
+ {
+ // If this is bound to a SOAPElement, or Element, then we can return
+ // the content element as is.
+ // Note, that it is possible for a Java type to be bound to an any
+ // type, so checking the xml type is not sufficient.
+ if (!Element.class.isAssignableFrom(javaType))
+ {
+ SOAPContentElement soapElement = (SOAPContentElement)paramValue;
+ retValue = soapElement.getObjectValue();
+ }
+ }
+
+ if (log.isDebugEnabled())
+ log.debug("transformPayloadValue: " + getTypeName(paramValue) + "
-> " + getTypeName(retValue));
+ return retValue;
+ }
+
+ /** Synchronize the operation IN, INOUT paramters with the call input parameters.
+ * Essetially it unwrapps holders and converts primitives to wrapper types.
+ */
+ public void initInputParams(Object[] inputParams)
+ {
+ for (ParameterMetaData paramMetaData : opMetaData.getParameters())
+ {
+ int index = paramMetaData.getIndex();
+
+ // doc/lit wrapped return headers are OUT, so skip
+ if (index < 0)
+ continue;
+
+ QName xmlName = paramMetaData.getXmlName();
+ Class javaType = paramMetaData.getJavaType();
+
+ Object value;
+ if (opMetaData.isDocumentWrapped() && !paramMetaData.isInHeader()
&& !paramMetaData.isSwA())
+ {
+ value = ParameterWrapping.wrapRequestParameters(paramMetaData, inputParams);
+ }
+ else
+ {
+ value = inputParams[index];
+ if (value != null)
+ {
+ Class inputType = value.getClass();
+
+ if (HolderUtils.isHolderType(inputType))
+ {
+ // At runtime we lose the generic info for JAX-WS types,
+ // So we use the actual instance type
+ value = HolderUtils.getHolderValue(value);
+ inputType = (value == null) ? null : value.getClass();
+ }
+
+ // Verify that the java type matches a registered xmlType
+ // Attachments are skipped because they don't use type mapping
+ if (value != null && !paramMetaData.isSwA() &&
!paramMetaData.isXOP())
+ {
+ if (JavaUtils.isAssignableFrom(javaType, inputType) == false)
+ throw new WSException("Parameter '" + javaType +
"' not assignable from: " + inputType);
+ }
+ }
+ }
+
+ setRequestParamValue(xmlName, value);
+ }
+ }
+
+ /**
+ * Synchronize the operation paramters with the endpoint method parameters
+ */
+ private void syncEndpointInputParam(ParameterMetaData paramMetaData, final Object
paramValue, Object[] payload)
+ {
+ Object retValue = paramValue;
+ Method method = opMetaData.getJavaMethod();
+ Class[] targetParameterTypes = method.getParameterTypes();
+
+ if (opMetaData.isDocumentWrapped() && !paramMetaData.isInHeader()
&& !paramMetaData.isSwA() && !paramMetaData.isMessageType())
+ {
+ outParameters = ParameterWrapping.unwrapRequestParameters(paramMetaData,
paramValue, payload);
+ syncOutWrappedParameters(targetParameterTypes, payload);
+ }
+ else
+ {
+ // Replace INOUT and OUT parameters by their respective holder values
+ int index = paramMetaData.getIndex();
+ Class targetParameterType = targetParameterTypes[index];
+
+ if (paramMetaData.getMode() == ParameterMode.INOUT || paramMetaData.getMode() ==
ParameterMode.OUT)
+ {
+ retValue = HolderUtils.createHolderInstance(paramValue,
targetParameterType);
+
+ QName xmlName = paramMetaData.getXmlName();
+ setResponseParamValue(xmlName, retValue);
+ }
+
+ if (retValue != null)
+ {
+ Class valueType = retValue.getClass();
+ if (JavaUtils.isAssignableFrom(targetParameterType, valueType) == false)
+ throw new WSException("Parameter " +
targetParameterType.getName() + " is not assignable from: " +
getTypeName(retValue));
+
+ if (valueType.isArray())
+ retValue = JavaUtils.syncArray(retValue, targetParameterType);
+ }
+
+ if (log.isDebugEnabled())
+ log.debug("syncEndpointInputParam: " + getTypeName(paramValue) +
" -> " + getTypeName(retValue) + "(" + index + ")");
+ payload[index] = retValue;
+ }
+ }
+
+ private void syncOutWrappedParameters(Class[] targetParameterTypes, Object[] payload)
+ {
+ ParameterMetaData returnMetaData = opMetaData.getReturnParameter();
+ if (returnMetaData != null)
+ {
+ for (WrappedParameter param : returnMetaData.getWrappedParameters())
+ {
+ try
+ {
+ // only OUT parameters need to be initialized
+ if (param.getIndex() >= 0 &&
!outParameters.containsKey(param.getIndex()))
+ {
+ Object holder = targetParameterTypes[param.getIndex()].newInstance();
+ payload[param.getIndex()] = holder;
+ outParameters.put(param.getIndex(), holder);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Could not add output param: " +
param.getName(), e);
+
+ }
+ }
+ }
+ }
+
+ private String getTypeName(Object value)
+ {
+ String valueType = (value != null ? value.getClass().getName() : null);
+ return valueType;
+ }
+}
\ No newline at end of file
Deleted:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/ServiceEndpointInvocation.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/ServiceEndpointInvocation.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/ServiceEndpointInvocation.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -1,397 +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.ws.core;
-
-// $Id$
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.ParameterWrapping;
-import org.jboss.ws.core.soap.SOAPContentElement;
-import org.jboss.ws.core.utils.HolderUtils;
-import org.jboss.ws.core.utils.MimeUtils;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
-import org.jboss.wsf.spi.utils.JavaUtils;
-import org.w3c.dom.Element;
-
-/** A web service invocation.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Oct-2004
- */
-public class ServiceEndpointInvocation
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ServiceEndpointInvocation.class);
-
- // The operation meta data for this invocation
- private OperationMetaData opMetaData;
- // Map the named endpoint parameters
- private Map<QName, Object> reqPayload = new LinkedHashMap<QName,
Object>();
- // Map the named endpoint parameters
- private Map<QName, Object> resPayload = new LinkedHashMap<QName,
Object>();
- // The return value
- private Object returnValue;
- // Map of output parameters, key being the parameter index in the method signature
- private Map<Integer, Object> outParameters = new HashMap<Integer,
Object>();
-
- public ServiceEndpointInvocation(OperationMetaData opMetaData)
- {
- this.opMetaData = opMetaData;
- }
-
- public OperationMetaData getOperationMetaData()
- {
- return opMetaData;
- }
-
- public Method getJavaMethod()
- {
- return opMetaData.getJavaMethod();
- }
-
- public Map<Integer, Object> getOutParameters()
- {
- return outParameters;
- }
-
- public List<QName> getRequestParamNames()
- {
- List<QName> xmlNames = new ArrayList<QName>();
- xmlNames.addAll(reqPayload.keySet());
- return xmlNames;
- }
-
- public void setRequestParamValue(QName xmlName, Object value)
- {
- if (log.isDebugEnabled())
- log.debug("setRequestParamValue: [name=" + xmlName +
",value=" + getTypeName(value) + "]");
- reqPayload.put(xmlName, value);
- }
-
- public Object getRequestParamValue(QName xmlName)
- {
- if (log.isDebugEnabled())
- log.debug("getRequestParamValue: " + xmlName);
- Object paramValue = reqPayload.get(xmlName);
- ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
- try
- {
- paramValue = transformPayloadValue(paramMetaData, paramValue);
- }
- catch (SOAPException ex)
- {
- throw new WSException(ex);
- }
- return paramValue;
- }
-
- /** Returns the payload that can be passed on to the endpoint implementation
- */
- public Object[] getRequestPayload()
- {
- log.debug("getRequestPayload");
- List<QName> xmlNames = getRequestParamNames();
-
- Object[] payload = new
Object[opMetaData.getJavaMethod().getParameterTypes().length];
- for (int i = 0; i < xmlNames.size(); i++)
- {
- QName xmlName = xmlNames.get(i);
- Object paramValue = getRequestParamValue(xmlName);
-
- ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
- syncEndpointInputParam(paramMetaData, paramValue, payload);
- }
-
- return payload;
- }
-
- public List<QName> getResponseParamNames()
- {
- List<QName> xmlNames = new ArrayList<QName>();
- xmlNames.addAll(resPayload.keySet());
- return xmlNames;
- }
-
- public void setResponseParamValue(QName xmlName, Object value)
- {
- if (log.isDebugEnabled())
- log.debug("setResponseParamValue: [name=" + xmlName +
",value=" + getTypeName(value) + "]");
- resPayload.put(xmlName, value);
- }
-
- public Object getResponseParamValue(QName xmlName) throws SOAPException
- {
- if (log.isDebugEnabled())
- log.debug("getResponseParamValue: " + xmlName);
- Object paramValue = resPayload.get(xmlName);
- ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
- paramValue = transformPayloadValue(paramMetaData, paramValue);
- if (paramValue != null)
- {
- Class valueType = paramValue.getClass();
- if (HolderUtils.isHolderType(valueType))
- {
- paramValue = HolderUtils.getHolderValue(paramValue);
- }
- }
- return paramValue;
- }
-
- public void setReturnValue(Object value)
- {
- ParameterMetaData retMetaData = opMetaData.getReturnParameter();
- if (value != null && retMetaData == null)
- throw new WSException("Operation does not have a return value: " +
opMetaData.getQName());
-
- if (log.isDebugEnabled())
- log.debug("setReturnValue: " + getTypeName(value));
- this.returnValue = value;
- }
-
- public Object getReturnValue()
- {
- if (log.isDebugEnabled())
- log.debug("getReturnValue");
- Object paramValue = returnValue;
- ParameterMetaData paramMetaData = opMetaData.getReturnParameter();
- if (paramMetaData != null)
- {
- try
- {
- paramValue = transformPayloadValue(paramMetaData, paramValue);
- }
- catch (SOAPException ex)
- {
- throw new WSException(ex);
- }
- }
- return paramValue;
- }
-
- private Object transformPayloadValue(ParameterMetaData paramMetaData, final Object
paramValue) throws SOAPException
- {
- QName xmlName = paramMetaData.getXmlName();
- QName xmlType = paramMetaData.getXmlType();
- Class<?> javaType = paramMetaData.getJavaType();
- String javaName = paramMetaData.getJavaTypeName();
-
- if (xmlType == null)
- throw new IllegalStateException("Cannot obtain xml type for:
[xmlName=" + xmlName + ",javaName=" + javaName + "]");
-
- Object retValue = paramValue;
-
- // Handle attachment part
- if (paramValue instanceof AttachmentPart)
- {
- AttachmentPart part = (AttachmentPart)paramValue;
-
- Set mimeTypes = paramMetaData.getMimeTypes();
- if (DataHandler.class.isAssignableFrom(javaType) &&
!javaType.equals(Object.class))
- {
- DataHandler handler = part.getDataHandler();
- String mimeType = MimeUtils.getBaseMimeType(handler.getContentType());
-
- // JAX-WS 2.0, 2.6.3.1 MIME Content
- // Conformance (MIME type mismatch): On receipt of a message where the MIME
type of a part does not
- // match that described in the WSDL an implementation SHOULD throw a
WebServiceException.
- if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
- log.warn("Mime type " + mimeType + " not allowed for
parameter " + xmlName + " allowed types are " + mimeTypes);
-
- retValue = part.getDataHandler();
- }
- else
- {
- retValue = part.getContent();
- String mimeType = MimeUtils.getBaseMimeType(part.getContentType());
-
- if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
- throw new SOAPException("Mime type " + mimeType + " not
allowed for parameter " + xmlName + " allowed types are " + mimeTypes);
-
- if (retValue != null)
- {
- Class valueType = retValue.getClass();
- if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
- throw new SOAPException("javaType [" + javaType.getName() +
"] is not assignable from attachment content: " + valueType.getName());
- }
- }
- }
- else if (paramValue instanceof SOAPContentElement)
- {
- // If this is bound to a SOAPElement, or Element, then we can return
- // the content element as is.
- // Note, that it is possible for a Java type to be bound to an any
- // type, so checking the xml type is not sufficient.
- if (!Element.class.isAssignableFrom(javaType))
- {
- SOAPContentElement soapElement = (SOAPContentElement)paramValue;
- retValue = soapElement.getObjectValue();
- }
- }
-
- if (log.isDebugEnabled())
- log.debug("transformPayloadValue: " + getTypeName(paramValue) + "
-> " + getTypeName(retValue));
- return retValue;
- }
-
- /** Synchronize the operation IN, INOUT paramters with the call input parameters.
- * Essetially it unwrapps holders and converts primitives to wrapper types.
- */
- public void initInputParams(Object[] inputParams)
- {
- for (ParameterMetaData paramMetaData : opMetaData.getParameters())
- {
- int index = paramMetaData.getIndex();
-
- // doc/lit wrapped return headers are OUT, so skip
- if (index < 0)
- continue;
-
- QName xmlName = paramMetaData.getXmlName();
- Class javaType = paramMetaData.getJavaType();
-
- Object value;
- if (opMetaData.isDocumentWrapped() && !paramMetaData.isInHeader()
&& !paramMetaData.isSwA())
- {
- value = ParameterWrapping.wrapRequestParameters(paramMetaData, inputParams);
- }
- else
- {
- value = inputParams[index];
- if (value != null)
- {
- Class inputType = value.getClass();
-
- if (HolderUtils.isHolderType(inputType))
- {
- // At runtime we lose the generic info for JAX-WS types,
- // So we use the actual instance type
- value = HolderUtils.getHolderValue(value);
- inputType = (value == null) ? null : value.getClass();
- }
-
- // Verify that the java type matches a registered xmlType
- // Attachments are skipped because they don't use type mapping
- if (value != null && !paramMetaData.isSwA() &&
!paramMetaData.isXOP())
- {
- if (JavaUtils.isAssignableFrom(javaType, inputType) == false)
- throw new WSException("Parameter '" + javaType +
"' not assignable from: " + inputType);
- }
- }
- }
-
- setRequestParamValue(xmlName, value);
- }
- }
-
- /**
- * Synchronize the operation paramters with the endpoint method parameters
- */
- private void syncEndpointInputParam(ParameterMetaData paramMetaData, final Object
paramValue, Object[] payload)
- {
- Object retValue = paramValue;
- Method method = opMetaData.getJavaMethod();
- Class[] targetParameterTypes = method.getParameterTypes();
-
- if (opMetaData.isDocumentWrapped() && !paramMetaData.isInHeader()
&& !paramMetaData.isSwA() && !paramMetaData.isMessageType())
- {
- outParameters = ParameterWrapping.unwrapRequestParameters(paramMetaData,
paramValue, payload);
- syncOutWrappedParameters(targetParameterTypes, payload);
- }
- else
- {
- // Replace INOUT and OUT parameters by their respective holder values
- int index = paramMetaData.getIndex();
- Class targetParameterType = targetParameterTypes[index];
-
- if (paramMetaData.getMode() == ParameterMode.INOUT || paramMetaData.getMode() ==
ParameterMode.OUT)
- {
- retValue = HolderUtils.createHolderInstance(paramValue,
targetParameterType);
-
- QName xmlName = paramMetaData.getXmlName();
- setResponseParamValue(xmlName, retValue);
- }
-
- if (retValue != null)
- {
- Class valueType = retValue.getClass();
- if (JavaUtils.isAssignableFrom(targetParameterType, valueType) == false)
- throw new WSException("Parameter " +
targetParameterType.getName() + " is not assignable from: " +
getTypeName(retValue));
-
- if (valueType.isArray())
- retValue = JavaUtils.syncArray(retValue, targetParameterType);
- }
-
- if (log.isDebugEnabled())
- log.debug("syncEndpointInputParam: " + getTypeName(paramValue) +
" -> " + getTypeName(retValue) + "(" + index + ")");
- payload[index] = retValue;
- }
- }
-
- private void syncOutWrappedParameters(Class[] targetParameterTypes, Object[] payload)
- {
- ParameterMetaData returnMetaData = opMetaData.getReturnParameter();
- if (returnMetaData != null)
- {
- for (WrappedParameter param : returnMetaData.getWrappedParameters())
- {
- try
- {
- // only OUT parameters need to be initialized
- if (param.getIndex() >= 0 &&
!outParameters.containsKey(param.getIndex()))
- {
- Object holder = targetParameterTypes[param.getIndex()].newInstance();
- payload[param.getIndex()] = holder;
- outParameters.put(param.getIndex(), holder);
- }
- }
- catch (Exception e)
- {
- throw new WSException("Could not add output param: " +
param.getName(), e);
-
- }
- }
- }
- }
-
- private String getTypeName(Object value)
- {
- String valueType = (value != null ? value.getClass().getName() : null);
- return valueType;
- }
-}
\ No newline at end of file
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -36,7 +36,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonBinding;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.ServiceEndpointInvocation;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.HTTPMessageImpl;
import org.jboss.ws.core.HeaderSource;
import org.jboss.ws.core.MessageAbstraction;
@@ -60,19 +60,19 @@
private BindingImpl delegate = new BindingImpl();
- public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData,
ServiceEndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData,
EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
throws BindingException
{
throw new NotImplementedException();
}
- public ServiceEndpointInvocation unbindRequestMessage(OperationMetaData opMetaData,
MessageAbstraction reqMessage) throws BindingException
+ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData,
MessageAbstraction reqMessage) throws BindingException
{
log.debug("unbindRequestMessage: " + opMetaData.getQName());
try
{
// Construct the endpoint invocation object
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
if (msgContext == null)
@@ -95,7 +95,7 @@
}
}
- public MessageAbstraction bindResponseMessage(OperationMetaData opMetaData,
ServiceEndpointInvocation epInv) throws BindingException
+ public MessageAbstraction bindResponseMessage(OperationMetaData opMetaData,
EndpointInvocation epInv) throws BindingException
{
log.debug("bindResponseMessage: " + opMetaData.getQName());
try
@@ -118,7 +118,7 @@
}
}
- public void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction
resMessage, ServiceEndpointInvocation epInv, Map<QName, UnboundHeader>
unboundHeaders)
+ public void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction
resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
throws BindingException
{
throw new NotImplementedException();
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -34,7 +34,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonBinding;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.ServiceEndpointInvocation;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.HeaderSource;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
@@ -61,19 +61,19 @@
private BindingImpl delegate = new BindingImpl();
/** On the client side, generate the payload from IN parameters. */
- public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData,
ServiceEndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws
BindingException
+ public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData,
EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws
BindingException
{
throw new NotImplementedException();
}
/** On the server side, extract the IN parameters from the payload and populate an
Invocation object */
- public ServiceEndpointInvocation unbindRequestMessage(OperationMetaData opMetaData,
MessageAbstraction reqMessage) throws BindingException
+ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData,
MessageAbstraction reqMessage) throws BindingException
{
log.debug("unbindRequestMessage: " + opMetaData.getQName());
try
{
// Construct the endpoint invocation object
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
SOAPMessageContextJAXWS msgContext =
(SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
if (msgContext == null)
@@ -93,7 +93,7 @@
}
/** On the server side, generate the payload from OUT parameters. */
- public MessageAbstraction bindResponseMessage(OperationMetaData opMetaData,
ServiceEndpointInvocation epInv) throws BindingException
+ public MessageAbstraction bindResponseMessage(OperationMetaData opMetaData,
EndpointInvocation epInv) throws BindingException
{
log.debug("bindResponseMessage: " + opMetaData.getQName());
try
@@ -116,7 +116,7 @@
}
/** On the client side, extract the OUT parameters from the payload and return them to
the client. */
- public void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction
resMessage, ServiceEndpointInvocation epInv, Map<QName, UnboundHeader>
unboundHeaders)
+ public void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction
resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
throws BindingException
{
throw new NotImplementedException();
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -37,7 +37,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonBinding;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.ServiceEndpointInvocation;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.HeaderSource;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
@@ -69,20 +69,20 @@
private BindingImpl delegate = new BindingImpl();
/** On the client side, generate the payload from IN parameters. */
- public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData,
ServiceEndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData,
EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
throws BindingException
{
throw new NotImplementedException();
}
/** On the server side, extract the IN parameters from the payload and populate an
Invocation object */
- public ServiceEndpointInvocation unbindRequestMessage(OperationMetaData opMetaData,
MessageAbstraction payload) throws BindingException
+ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData,
MessageAbstraction payload) throws BindingException
{
log.debug("unbindRequestMessage: " + opMetaData.getQName());
try
{
// Construct the endpoint invocation object
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
if (msgContext == null)
@@ -111,7 +111,7 @@
}
/** On the server side, generate the payload from OUT parameters. */
- public MessageAbstraction bindResponseMessage(OperationMetaData opMetaData,
ServiceEndpointInvocation epInv) throws BindingException
+ public MessageAbstraction bindResponseMessage(OperationMetaData opMetaData,
EndpointInvocation epInv) throws BindingException
{
log.debug("bindResponseMessage: " + opMetaData.getQName());
@@ -146,7 +146,7 @@
}
/** On the client side, extract the OUT parameters from the payload and return them to
the client. */
- public void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction
resMessage, ServiceEndpointInvocation epInv, Map<QName, UnboundHeader>
unboundHeaders)
+ public void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction
resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
throws BindingException
{
throw new NotImplementedException();
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-22
13:25:27 UTC (rev 3184)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -50,7 +50,7 @@
import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.core.DirectionHolder;
import org.jboss.ws.core.MessageAbstraction;
-import org.jboss.ws.core.ServiceEndpointInvocation;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.DirectionHolder.Direction;
import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
@@ -69,7 +69,7 @@
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.BasicEndpointInvocation;
-import org.jboss.wsf.spi.invocation.EndpointInvocation;
+import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.WebServiceContextJSE;
@@ -151,7 +151,7 @@
try
{
boolean oneway = false;
- ServiceEndpointInvocation sepInv = null;
+ EndpointInvocation sepInv = null;
OperationMetaData opMetaData = null;
CommonBinding binding = bindingProvider.getCommonBinding();
binding.setHeaderSource(delegate);
@@ -202,7 +202,7 @@
}
// Invoke an instance of the SEI implementation bean
- EndpointInvocation inv = setupInvocation(endpoint, sepInv, invContext);
+ Invocation inv = setupInvocation(endpoint, sepInv, invContext);
InvocationHandler invHandler = endpoint.getInvocationHandler();
invHandler.invoke(endpoint, null, inv);
}
@@ -277,7 +277,7 @@
}
}
- protected EndpointInvocation setupInvocation(Endpoint ep, ServiceEndpointInvocation
sepInv, InvocationContext invContext) throws Exception
+ protected Invocation setupInvocation(Endpoint ep, EndpointInvocation sepInv,
InvocationContext invContext) throws Exception
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
if (msgContext instanceof SOAPMessageContextJAXWS)
@@ -295,14 +295,14 @@
invContext.addAttachment(ServletEndpointContext.class, servletEndpointContext);
}
- EndpointInvocation inv = new DelegatingInvocation(sepInv);
+ Invocation inv = new DelegatingInvocation(sepInv);
inv.setInvocationContext(invContext);
inv.setJavaMethod(getImplMethod(endpoint, sepInv));
return inv;
}
- protected Method getImplMethod(Endpoint endpoint, ServiceEndpointInvocation sepInv)
throws ClassNotFoundException, NoSuchMethodException
+ protected Method getImplMethod(Endpoint endpoint, EndpointInvocation sepInv) throws
ClassNotFoundException, NoSuchMethodException
{
Class implClass = endpoint.getTargetBeanClass();
Method seiMethod = sepInv.getJavaMethod();
@@ -426,9 +426,9 @@
class DelegatingInvocation extends BasicEndpointInvocation
{
- private ServiceEndpointInvocation sepInv;
+ private EndpointInvocation sepInv;
- public DelegatingInvocation(ServiceEndpointInvocation sepInv)
+ public DelegatingInvocation(EndpointInvocation sepInv)
{
this.sepInv = sepInv;
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -23,10 +23,10 @@
// $Id$
-import org.jboss.ws.core.ServiceEndpointInvocation;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.EndpointInvocation;
+import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.HandlerCallback;
import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -40,9 +40,9 @@
public class ServiceEndpointInvokerEJB21 extends ServiceEndpointInvoker
{
@Override
- protected EndpointInvocation setupInvocation(Endpoint ep, ServiceEndpointInvocation
epInv, InvocationContext invContext) throws Exception
+ protected Invocation setupInvocation(Endpoint ep, EndpointInvocation epInv,
InvocationContext invContext) throws Exception
{
- EndpointInvocation inv = super.setupInvocation(ep, epInv, invContext);
+ Invocation inv = super.setupInvocation(ep, epInv, invContext);
// Attach the handler callback
ServerEndpointMetaData sepMetaData =
endpoint.getAttachment(ServerEndpointMetaData.class);
Modified:
trunk/jbossws-core/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/jbossws-core/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -27,7 +27,7 @@
import javax.xml.rpc.server.ServletEndpointContext;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.EndpointInvocation;
+import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.invocation.InvocationHandlerJSE;
@@ -39,7 +39,7 @@
*/
public class ServiceLifecycleInvocationHandler extends InvocationHandlerJSE
{
- public void invoke(Endpoint ep, Object beanInstance, EndpointInvocation epInv) throws
Exception
+ public void invoke(Endpoint ep, Object beanInstance, Invocation epInv) throws
Exception
{
try
{
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
---
trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -40,7 +40,7 @@
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.CommonSOAPBinding;
-import org.jboss.ws.core.ServiceEndpointInvocation;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.client.CallImpl;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.soap.MessageContextAssociation;
@@ -176,7 +176,7 @@
CommonBindingProvider bindingProvider = new
CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING, Type.JAXRPC);
CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(new Object[]{"Hello World!"});
SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv,
null);
@@ -202,7 +202,7 @@
paramMetaData.setInHeader(true);
paramMetaData.setIndex(1);
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(new Object[]{"Hello World!", "IN header
message"});
SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv,
null);
@@ -229,7 +229,7 @@
Map headers = new HashMap();
headers.put(xmlName, header);
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(new Object[]{"Hello World!"});
SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv,
headers);
@@ -256,7 +256,7 @@
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setSOAPMessage(reqMessage);
- ServiceEndpointInvocation epInv = binding.unbindRequestMessage(opMetaData,
reqMessage);
+ EndpointInvocation epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
assertNotNull(epInv);
Object[] args = epInv.getRequestPayload();
@@ -285,7 +285,7 @@
CommonBindingProvider bindingProvider = new
CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING, Type.JAXRPC);
CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();
- ServiceEndpointInvocation epInv = binding.unbindRequestMessage(opMetaData,
reqMessage);
+ EndpointInvocation epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
assertNotNull(epInv);
Object[] args = epInv.getRequestPayload();
@@ -308,7 +308,7 @@
CommonBindingProvider bindingProvider = new
CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING, Type.JAXRPC);
CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();
- ServiceEndpointInvocation epInv = binding.unbindRequestMessage(opMetaData,
reqMessage);
+ EndpointInvocation epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
assertNotNull(epInv);
Object[] args = epInv.getRequestPayload();
@@ -323,7 +323,7 @@
CommonBindingProvider bindingProvider = new
CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING, Type.JAXRPC);
CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
epInv.setReturnValue("Hello World!");
SOAPMessage resMessage = (SOAPMessage)binding.bindResponseMessage(opMetaData,
epInv);
@@ -350,7 +350,7 @@
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setSOAPMessage(resMessage);
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
binding.unbindResponseMessage(opMetaData, resMessage, epInv, null);
assertEquals("Hello World!", epInv.getReturnValue());
}
@@ -378,7 +378,7 @@
paramMetaData.setIndex(1);
opMetaData.addParameter(paramMetaData);
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
binding.unbindResponseMessage(opMetaData, resMessage, epInv, null);
assertEquals("Hello World!", epInv.getReturnValue());
@@ -407,7 +407,7 @@
Map headers = new HashMap();
headers.put(xmlName, header);
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
binding.unbindResponseMessage(opMetaData, resMessage, epInv, headers);
assertEquals("Hello World!", epInv.getReturnValue());
@@ -431,7 +431,7 @@
try
{
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
binding.unbindResponseMessage(opMetaData, resMessage, epInv, null);
fail("SOAPFaultException expected");
}
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
===================================================================
---
trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2007-05-22
13:25:27 UTC (rev 3184)
+++
trunk/jbossws-core/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2007-05-22
13:40:41 UTC (rev 3185)
@@ -44,7 +44,7 @@
import org.jboss.ws.core.CommonBinding;
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.core.CommonSOAPBinding;
-import org.jboss.ws.core.ServiceEndpointInvocation;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.client.CallImpl;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.soap.MessageContextAssociation;
@@ -150,7 +150,7 @@
CommonBindingProvider bindingProvider = new
CommonBindingProvider(CommonSOAPBinding.SOAP11HTTP_BINDING, Type.JAXRPC);
CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();
- ServiceEndpointInvocation epInv = new ServiceEndpointInvocation(opMetaData);
+ EndpointInvocation epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(new Object[]{"Hello World!", "hi"});
SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv,
null);