Author: thomas.diesler(a)jboss.com
Date: 2007-01-05 16:52:07 -0500 (Fri, 05 Jan 2007)
New Revision: 1829
Added:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/PortProxy.java
Removed:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java
Modified:
trunk/jbossws-core/.classpath
trunk/jbossws-core/build.xml
trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java
trunk/jbossws-core/src/main/resources/samples/common/build-thirdparty.xml
trunk/jbossws-core/src/main/resources/samples/common/imported-build.xml
Log:
Fix tomcat integration
Add config name/file access on StubExt
Modified: trunk/jbossws-core/.classpath
===================================================================
--- trunk/jbossws-core/.classpath 2007-01-05 16:10:32 UTC (rev 1828)
+++ trunk/jbossws-core/.classpath 2007-01-05 21:52:07 UTC (rev 1829)
@@ -36,5 +36,6 @@
<classpathentry kind="lib"
path="/build/thirdparty/xml-apis.jar"/>
<classpathentry kind="lib"
path="/build/thirdparty/xmlsec.jar"/>
<classpathentry kind="lib"
path="/build/thirdparty/xmlunit1.0.jar"/>
+ <classpathentry kind="lib"
path="/build/thirdparty/jboss-vfs.jar"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/jbossws-core/build.xml
===================================================================
--- trunk/jbossws-core/build.xml 2007-01-05 16:10:32 UTC (rev 1828)
+++ trunk/jbossws-core/build.xml 2007-01-05 21:52:07 UTC (rev 1829)
@@ -13,9 +13,8 @@
<project default="main" basedir="../jbossws-core"
name="JBossWS-Main">
- <import file="${basedir}/../build/ant-import/build-samples.xml"/>
- <import file="${basedir}/../build/ant-import/build-setup.xml"/>
<import file="${basedir}/../build/ant-import/build-thirdparty.xml"/>
+ <import file="${basedir}/../build/ant-import/build-setup.xml"/>
<property name="core.src.dir" value="${core.dir}/src/main"/>
<property name="core.java.dir"
value="${core.src.dir}/java"/>
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-01-05
16:10:32 UTC (rev 1828)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java 2007-01-05
21:52:07 UTC (rev 1829)
@@ -307,9 +307,6 @@
// unbind the return values
if (handlerPass)
{
- // BP-1.0 R1027
- HandlerChainBaseImpl.checkMustUnderstand(msgContext, new String[]{});
-
// unbind the return values
SOAPMessage resMessage = msgContext.getSOAPMessage();
binding.unbindResponseMessage(opMetaData, resMessage, epInv,
unboundHeaders);
@@ -320,6 +317,10 @@
handlerPass = handlerPass && callResponseHandlerChain(portName,
HandlerType.ENDPOINT);
handlerPass = handlerPass && callResponseHandlerChain(portName,
HandlerType.PRE);
+ // BP-1.0 R1027
+ if (handlerPass)
+ HandlerChainBaseImpl.checkMustUnderstand(msgContext, new String[]{});
+
// Check if protocol handlers modified the payload
if (((SOAPBodyImpl)reqMessage.getSOAPBody()).isModifiedFromSource())
{
@@ -327,7 +328,7 @@
SOAPMessage resMessage = msgContext.getSOAPMessage();
binding.unbindResponseMessage(opMetaData, resMessage, epInv,
unboundHeaders);
}
-
+
retObj = syncOutputParams(inputParams, epInv);
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2007-01-05
16:10:32 UTC (rev 1828)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2007-01-05
21:52:07 UTC (rev 1829)
@@ -140,6 +140,11 @@
setTargetEndpointAddress(epMetaData.getEndpointAddress());
}
+ public ServiceImpl getServiceImpl()
+ {
+ return jaxrpcService;
+ }
+
@Override
protected Map<String, Object> getRequestContext()
{
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java 2007-01-05
16:10:32 UTC (rev 1828)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java 2007-01-05
21:52:07 UTC (rev 1829)
@@ -1,207 +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.jaxrpc;
-
-// $Id$
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.rmi.RemoteException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.Stub;
-import javax.xml.rpc.soap.SOAPFaultException;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-/**
- * The dynamic proxy that delegates to the underlying Call implementation
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 07-Jan-2005
- */
-public class CallProxy implements InvocationHandler
-{
- // provide logging
- private static final Logger log = Logger.getLogger(CallProxy.class);
-
- // The underlying Call
- private CallImpl call;
- // List<Method> of the Stub methods
- private List stubMethods;
- // List<Method> of the Object methods
- private List objectMethods;
-
- // The set of standard properties
- private static final Set<String> standardProperties = new
HashSet<String>();
- static
- {
- standardProperties.add(Stub.ENDPOINT_ADDRESS_PROPERTY);
- standardProperties.add(Stub.SESSION_MAINTAIN_PROPERTY);
- standardProperties.add(Stub.USERNAME_PROPERTY);
- standardProperties.add(Stub.PASSWORD_PROPERTY);
- }
-
- // The map of jboss-ws4ee supported properties
- private static final Map<String,String> legacyPropertyMap = new
HashMap<String,String>();
- static
- {
- legacyPropertyMap.put("org.jboss.webservice.client.timeout",
StubExt.PROPERTY_CLIENT_TIMEOUT);
- legacyPropertyMap.put("org.jboss.webservice.keyStore",
StubExt.PROPERTY_KEY_STORE);
- legacyPropertyMap.put("org.jboss.webservice.keyStorePassword",
StubExt.PROPERTY_KEY_STORE_PASSWORD);
- legacyPropertyMap.put("org.jboss.webservice.keyStoreType",
StubExt.PROPERTY_KEY_STORE_TYPE);
- legacyPropertyMap.put("org.jboss.webservice.trustStore",
StubExt.PROPERTY_TRUST_STORE);
- legacyPropertyMap.put("org.jboss.webservice.trustStorePassword",
StubExt.PROPERTY_TRUST_STORE_PASSWORD);
- legacyPropertyMap.put("org.jboss.webservice.trustStoreType",
StubExt.PROPERTY_TRUST_STORE_TYPE);
- }
-
- public CallProxy(CallImpl call)
- {
- this.call = call;
- this.stubMethods = Arrays.asList(StubExt.class.getMethods());
- this.objectMethods = Arrays.asList(Object.class.getMethods());
- }
-
- /** Processes a method invocation on a proxy instance and returns the result.
- */
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- // An invocation on the Stub interface
- String methodName = method.getName();
- if (stubMethods.contains(method))
- {
- if (methodName.equals("_getPropertyNames"))
- {
- return call.getPropertyNames();
- }
- else if (methodName.equals("_getProperty"))
- {
- return getProperty((String)args[0]);
- }
- else if (methodName.equals("_setProperty"))
- {
- setProperty((String)args[0], args[1]);
- return null;
- }
- else
- {
- Method callMethod = CallImpl.class.getMethod(methodName,
method.getParameterTypes());
- return callMethod.invoke(call, args);
- }
- }
-
- // An invocation on proxy's Object class
- else if (objectMethods.contains(method))
- {
- Method callMethod = CallImpl.class.getMethod(methodName,
method.getParameterTypes());
- return callMethod.invoke(call, args);
- }
-
- // An invocation on the service endpoint interface
- else
- {
- EndpointMetaData epMetaData = call.getEndpointMetaData();
- OperationMetaData opMetaData = epMetaData.getOperation(method);
- if (opMetaData == null)
- throw new WSException("Cannot obtain operation meta data for: " +
methodName);
-
- call.setOperationName(opMetaData.getQName());
-
- try
- {
- if (opMetaData.isOneWay())
- {
- call.invokeOneWay(args);
- return null;
- }
- else
- {
- Object retObj = call.invoke(args);
- if (retObj != null)
- {
- Class retType = method.getReturnType();
- if (retType == null)
- throw new WSException("Return value not supported by: " +
opMetaData);
-
- if (JavaUtils.isPrimitive(retType))
- retObj = JavaUtils.getPrimitiveValueArray(retObj);
- }
- return retObj;
- }
- }
- catch (Exception ex)
- {
- handleException(ex);
- return null;
- }
- }
- }
-
- private Object getProperty(String name)
- {
- name = assertPropertyName(name);
- return call.getProperty(name);
- }
-
- private void setProperty(String name, Object value)
- {
- name = assertPropertyName(name);
- call.setProperty(name, value);
- }
-
- private String assertPropertyName(String name)
- {
- if (name != null && name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
- throw new JAXRPCException("Unsupported property: " + name);
-
- if (legacyPropertyMap.keySet().contains(name))
- {
- String jbosswsName = legacyPropertyMap.get(name);
- log.warn("Legacy propery '" + name + "' mapped to
'" + jbosswsName + "'");
- name = jbosswsName;
- }
-
- return name;
- }
-
- private void handleException(Exception ex) throws Throwable
- {
- Throwable th = ex;
- if (ex instanceof RemoteException && ex.getCause() instanceof
SOAPFaultException)
- {
- SOAPFaultException faultEx = (SOAPFaultException)ex.getCause();
- if (faultEx.getCause() != null)
- th = faultEx.getCause();
- }
- throw th;
- }
-}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java 2007-01-05
16:10:32 UTC (rev 1828)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/HandlerRegistryImpl.java 2007-01-05
21:52:07 UTC (rev 1829)
@@ -79,7 +79,6 @@
list = new ArrayList<HandlerInfo>();
return new ArrayList(list);
-
}
public void setHandlerChain(QName portName, List chain)
Copied: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/PortProxy.java (from rev
1775, trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java)
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallProxy.java 2007-01-02
19:15:19 UTC (rev 1775)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/PortProxy.java 2007-01-05
21:52:07 UTC (rev 1829)
@@ -0,0 +1,242 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.core.jaxrpc;
+
+// $Id$
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.Stub;
+import javax.xml.rpc.handler.HandlerInfo;
+import javax.xml.rpc.soap.SOAPFaultException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * The dynamic proxy that delegates to the underlying Call implementation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jan-2005
+ */
+public class PortProxy implements InvocationHandler
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(PortProxy.class);
+
+ // The underlying Call
+ private CallImpl call;
+ // List<Method> of the Stub methods
+ private List stubMethods;
+ // List<Method> of the Object methods
+ private List objectMethods;
+
+ // The set of standard properties
+ private static final Set<String> standardProperties = new
HashSet<String>();
+ static
+ {
+ standardProperties.add(Stub.ENDPOINT_ADDRESS_PROPERTY);
+ standardProperties.add(Stub.SESSION_MAINTAIN_PROPERTY);
+ standardProperties.add(Stub.USERNAME_PROPERTY);
+ standardProperties.add(Stub.PASSWORD_PROPERTY);
+ }
+
+ // The map of jboss-ws4ee supported properties
+ private static final Map<String,String> legacyPropertyMap = new
HashMap<String,String>();
+ static
+ {
+ legacyPropertyMap.put("org.jboss.webservice.client.timeout",
StubExt.PROPERTY_CLIENT_TIMEOUT);
+ legacyPropertyMap.put("org.jboss.webservice.keyStore",
StubExt.PROPERTY_KEY_STORE);
+ legacyPropertyMap.put("org.jboss.webservice.keyStorePassword",
StubExt.PROPERTY_KEY_STORE_PASSWORD);
+ legacyPropertyMap.put("org.jboss.webservice.keyStoreType",
StubExt.PROPERTY_KEY_STORE_TYPE);
+ legacyPropertyMap.put("org.jboss.webservice.trustStore",
StubExt.PROPERTY_TRUST_STORE);
+ legacyPropertyMap.put("org.jboss.webservice.trustStorePassword",
StubExt.PROPERTY_TRUST_STORE_PASSWORD);
+ legacyPropertyMap.put("org.jboss.webservice.trustStoreType",
StubExt.PROPERTY_TRUST_STORE_TYPE);
+ }
+
+ public PortProxy(CallImpl call)
+ {
+ this.call = call;
+ this.stubMethods = Arrays.asList(StubExt.class.getMethods());
+ this.objectMethods = Arrays.asList(Object.class.getMethods());
+ }
+
+ /** Processes a method invocation on a proxy instance and returns the result.
+ */
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ // An invocation on the Stub interface
+ String methodName = method.getName();
+ if (stubMethods.contains(method))
+ {
+ if (methodName.equals("_getPropertyNames"))
+ {
+ return call.getPropertyNames();
+ }
+ else if (methodName.equals("_getProperty"))
+ {
+ return getProperty((String)args[0]);
+ }
+ else if (methodName.equals("_setProperty"))
+ {
+ setProperty((String)args[0], args[1]);
+ return null;
+ }
+ else if (methodName.equals("getConfigFile"))
+ {
+ EndpointMetaData epMetaData = call.getEndpointMetaData();
+ return epMetaData.getConfigFile();
+ }
+ else if (methodName.equals("setConfigFile"))
+ {
+ EndpointMetaData epMetaData = call.getEndpointMetaData();
+ epMetaData.setConfigFile((String)args[0]);
+ return null;
+ }
+ else if (methodName.equals("getConfigName"))
+ {
+ EndpointMetaData epMetaData = call.getEndpointMetaData();
+ return epMetaData.getConfigName();
+ }
+ else if (methodName.equals("setConfigName"))
+ {
+ EndpointMetaData epMetaData = call.getEndpointMetaData();
+ epMetaData.setConfigName((String)args[0]);
+ epMetaData.configure(epMetaData);
+
+ // Reinitialize the client handler chain
+ ServiceImpl jaxrpcService = call.getServiceImpl();
+ jaxrpcService.setupHandlerChain(epMetaData);
+
+ return null;
+ }
+ else
+ {
+ Method callMethod = CallImpl.class.getMethod(methodName,
method.getParameterTypes());
+ return callMethod.invoke(call, args);
+ }
+ }
+
+ // An invocation on proxy's Object class
+ else if (objectMethods.contains(method))
+ {
+ Method callMethod = CallImpl.class.getMethod(methodName,
method.getParameterTypes());
+ return callMethod.invoke(call, args);
+ }
+
+ // An invocation on the service endpoint interface
+ else
+ {
+ EndpointMetaData epMetaData = call.getEndpointMetaData();
+ OperationMetaData opMetaData = epMetaData.getOperation(method);
+ if (opMetaData == null)
+ throw new WSException("Cannot obtain operation meta data for: " +
methodName);
+
+ call.setOperationName(opMetaData.getQName());
+
+ try
+ {
+ if (opMetaData.isOneWay())
+ {
+ call.invokeOneWay(args);
+ return null;
+ }
+ else
+ {
+ Object retObj = call.invoke(args);
+ if (retObj != null)
+ {
+ Class retType = method.getReturnType();
+ if (retType == null)
+ throw new WSException("Return value not supported by: " +
opMetaData);
+
+ if (JavaUtils.isPrimitive(retType))
+ retObj = JavaUtils.getPrimitiveValueArray(retObj);
+ }
+ return retObj;
+ }
+ }
+ catch (Exception ex)
+ {
+ handleException(ex);
+ return null;
+ }
+ }
+ }
+
+ private Object getProperty(String name)
+ {
+ name = assertPropertyName(name);
+ return call.getProperty(name);
+ }
+
+ private void setProperty(String name, Object value)
+ {
+ name = assertPropertyName(name);
+ call.setProperty(name, value);
+ }
+
+ private String assertPropertyName(String name)
+ {
+ if (name != null && name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
+ throw new JAXRPCException("Unsupported property: " + name);
+
+ if (legacyPropertyMap.keySet().contains(name))
+ {
+ String jbosswsName = legacyPropertyMap.get(name);
+ log.warn("Legacy propery '" + name + "' mapped to
'" + jbosswsName + "'");
+ name = jbosswsName;
+ }
+
+ return name;
+ }
+
+ private void handleException(Exception ex) throws Throwable
+ {
+ Throwable th = ex;
+ if (ex instanceof RemoteException && ex.getCause() instanceof
SOAPFaultException)
+ {
+ SOAPFaultException faultEx = (SOAPFaultException)ex.getCause();
+ if (faultEx.getCause() != null)
+ th = faultEx.getCause();
+ }
+ throw th;
+ }
+}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2007-01-05
16:10:32 UTC (rev 1828)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2007-01-05
21:52:07 UTC (rev 1829)
@@ -27,6 +27,8 @@
import java.net.URL;
import java.rmi.Remote;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -36,15 +38,21 @@
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.encoding.TypeMappingRegistry;
import javax.xml.rpc.handler.HandlerChain;
+import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.HandlerRegistry;
+import org.jboss.logging.Logger;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder;
import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
/**
@@ -61,6 +69,9 @@
*/
public class ServiceImpl implements ServiceExt
{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServiceImpl.class);
+
// The service meta data that is associated with this JAXRPC Service
private ServiceMetaData serviceMetaData;
@@ -379,7 +390,7 @@
{
CallImpl call = new CallImpl(this, epMetaData);
- CallProxy handler = new CallProxy(call);
+ PortProxy handler = new PortProxy(call);
ClassLoader cl = epMetaData.getClassLoader();
Remote proxy = (Remote)Proxy.newProxyInstance(cl, new Class[] { seiClass,
StubExt.class }, handler);
@@ -401,4 +412,37 @@
{
handlerRegistry.registerClientHandlerChain(portName, infos, roles);
}
+
+ void setupHandlerChain(EndpointMetaData epMetaData)
+ {
+ QName portName = epMetaData.getQName();
+ Set<String> handlerRoles = new HashSet<String>();
+ ArrayList handlerInfos = new ArrayList();
+ for (HandlerMetaData handlerMetaData :
epMetaData.getHandlerMetaData(HandlerType.ALL))
+ {
+ HandlerMetaDataJAXRPC jaxrpcMetaData = (HandlerMetaDataJAXRPC)handlerMetaData;
+ handlerRoles.addAll(jaxrpcMetaData.getSoapRoles());
+
+ HashMap hConfig = new HashMap();
+ for (HandlerInitParam param : jaxrpcMetaData.getInitParams())
+ {
+ hConfig.put(param.getParamName(), param.getParamValue());
+ }
+
+ Set<QName> headers = jaxrpcMetaData.getSoapHeaders();
+ QName[] headerArr = new QName[headers.size()];
+ headers.toArray(headerArr);
+
+ Class hClass = jaxrpcMetaData.getHandlerClass();
+ hConfig.put(HandlerType.class.getName(), jaxrpcMetaData.getHandlerType());
+ HandlerInfo info = new HandlerInfo(hClass, hConfig, headerArr);
+
+ log.debug("Adding client side handler to endpoint '" + portName +
"': " + info);
+ handlerInfos.add(info);
+
+ // register the handlers with the client engine
+ if (handlerInfos.size() > 0)
+ registerHandlerChain(portName, handlerInfos, handlerRoles);
+ }
+ }
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java 2007-01-05
16:10:32 UTC (rev 1828)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java 2007-01-05
21:52:07 UTC (rev 1829)
@@ -233,7 +233,7 @@
}
// Setup the handler chain
- setupHandlerChain(jaxrpcService, serviceRefMetaData);
+ setupHandlerChain(jaxrpcService);
InvocationHandler handler = new ServiceProxy(jaxrpcService, siClass);
return Proxy.newProxyInstance(contextCL, new Class[] { siClass, ServiceExt.class
}, handler);
@@ -247,45 +247,13 @@
/**
* Setup the handler chain(s) for this service
- * <p/>
- * This registers a handler chain with the service for every endpoint
- * that has handlers configured in the <service-ref> element
*/
- private void setupHandlerChain(ServiceImpl jaxrpcService, UnifiedServiceRefMetaData
serviceRefMetaData) throws Exception
+ private void setupHandlerChain(ServiceImpl jaxrpcService) throws Exception
{
List<EndpointMetaData> endpoints =
jaxrpcService.getServiceMetaData().getEndpoints();
for (EndpointMetaData epMetaData : endpoints)
{
- QName portName = epMetaData.getQName();
-
- Set<String> handlerRoles = new HashSet<String>();
- ArrayList handlerInfos = new ArrayList();
- for (HandlerMetaData handlerMetaData :
epMetaData.getHandlerMetaData(HandlerType.ALL))
- {
- HandlerMetaDataJAXRPC jaxrpcMetaData =
(HandlerMetaDataJAXRPC)handlerMetaData;
- handlerRoles.addAll(jaxrpcMetaData.getSoapRoles());
-
- HashMap hConfig = new HashMap();
- for (HandlerInitParam param : jaxrpcMetaData.getInitParams())
- {
- hConfig.put(param.getParamName(), param.getParamValue());
- }
-
- Set<QName> headers = jaxrpcMetaData.getSoapHeaders();
- QName[] headerArr = new QName[headers.size()];
- headers.toArray(headerArr);
-
- Class hClass = jaxrpcMetaData.getHandlerClass();
- hConfig.put(HandlerType.class.getName(), jaxrpcMetaData.getHandlerType());
- HandlerInfo info = new HandlerInfo(hClass, hConfig, headerArr);
-
- log.debug("Adding client side handler to endpoint '" + portName
+ "': " + info);
- handlerInfos.add(info);
-
- // register the handlers with the client engine
- if (handlerInfos.size() > 0)
- jaxrpcService.registerHandlerChain(portName, handlerInfos, handlerRoles);
- }
+ jaxrpcService.setupHandlerChain(epMetaData);
}
}
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java 2007-01-05
16:10:32 UTC (rev 1828)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/StubExt.java 2007-01-05
21:52:07 UTC (rev 1829)
@@ -109,4 +109,28 @@
* A propriatory extension, that is not part of JAXRPC.
*/
Iterator getUnboundHeaders();
+
+ /**
+ * Get the current port configuration file
+ * A propriatory extension, that is not part of JAXRPC.
+ */
+ String getConfigFile();
+
+ /**
+ * Set the current port configuration file
+ * A propriatory extension, that is not part of JAXRPC.
+ */
+ void setConfigFile(String configFile);
+
+ /**
+ * Get the current port configuration name
+ * A propriatory extension, that is not part of JAXRPC.
+ */
+ String getConfigName();
+
+ /**
+ * Set the current port configuration name
+ * A propriatory extension, that is not part of JAXRPC.
+ */
+ void setConfigName(String configName);
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-01-05
16:10:32 UTC (rev 1828)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-01-05
21:52:07 UTC (rev 1829)
@@ -64,8 +64,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 12-May-2005
*/
-public abstract class EndpointMetaData extends ExtensibleMetaData
- implements ConfigurationProvider, Configurable
+public abstract class EndpointMetaData extends ExtensibleMetaData implements
ConfigurationProvider, Configurable
{
// provide logging
private static Logger log = Logger.getLogger(EndpointMetaData.class);
@@ -163,10 +162,8 @@
public void setBindingId(String bindingId)
{
- if (!Constants.SOAP11HTTP_BINDING.equals(bindingId)
- && !Constants.SOAP12HTTP_BINDING.equals(bindingId)
- && !Constants.SOAP11HTTP_MTOM_BINDING.equals(bindingId)
- && !Constants.SOAP12HTTP_MTOM_BINDING.equals(bindingId))
+ if (!Constants.SOAP11HTTP_BINDING.equals(bindingId) &&
!Constants.SOAP12HTTP_BINDING.equals(bindingId) &&
!Constants.SOAP11HTTP_MTOM_BINDING.equals(bindingId)
+ && !Constants.SOAP12HTTP_MTOM_BINDING.equals(bindingId))
{
throw new WSException("Unsupported binding: " + bindingId);
}
@@ -198,7 +195,7 @@
/** Get the class loader associated with the endpoint meta data */
public ClassLoader getClassLoader()
{
- return getServiceMetaData().getUnifiedMetaData().getClassLoader();
+ return getServiceMetaData().getUnifiedMetaData().getClassLoader();
}
/**
@@ -393,10 +390,10 @@
boolean doesMatch = aux.getJavaMethod().equals(method);
// fallback for async methods
- if(!doesMatch &&
method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
+ if (!doesMatch &&
method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
{
String name = method.getName();
- name = name.substring(0, name.length()-5);
+ name = name.substring(0, name.length() - 5);
doesMatch = aux.getJavaName().equals(name);
}
@@ -522,7 +519,8 @@
List<Class> registeredTypes = typeMapping.getJavaTypes(xmlType);
boolean registered = false;
- for (Class current : registeredTypes) {
+ for (Class current : registeredTypes)
+ {
if (current.getName().equals(javaTypeName))
{
registered = true;
@@ -573,20 +571,21 @@
*
* @param configurable
*/
- public void configure(Configurable configurable) {
+ public void configure(Configurable configurable)
+ {
- if(null == endpointConfig)
+ if (endpointConfig == null)
{
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
endpointConfig = factory.getConfig(getConfigName(), getConfigFile());
}
// SOAPBinding configuration
- if(configurable instanceof CommonBindingProvider)
+ if (configurable instanceof CommonBindingProvider)
{
log.debug("Configure SOAPBinding");
- if(endpointConfig.hasFeature(EndpointFeature.MTOM))
+ if (endpointConfig.hasFeature(EndpointFeature.MTOM))
{
((CommonSOAPBinding)configurable).setMTOMEnabled(true);
log.debug("Enable MTOM on endpoint " + this.getQName());
@@ -594,9 +593,8 @@
}
// Configure EndpointMetaData
- else if(configurable instanceof EndpointMetaData)
+ else if (configurable instanceof EndpointMetaData)
{
-
log.debug("Configure EndpointMetaData");
List<HandlerMetaData> sepHandlers =
getHandlerMetaData(HandlerType.ENDPOINT);
@@ -612,7 +610,6 @@
log.debug("Added " + preHandlers.size() + " PRE handlers");
log.debug("Added " + postHandlers.size() + " POST
handlers");
}
-
}
public String getConfigFile()
@@ -636,5 +633,4 @@
this.configName = configName;
this.endpointConfig = null;
}
-
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java 2007-01-05
16:10:32 UTC (rev 1828)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java 2007-01-05
21:52:07 UTC (rev 1829)
@@ -26,7 +26,6 @@
import java.net.URL;
import org.jboss.logging.Logger;
-import org.jboss.virtual.VirtualFile;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
import org.jboss.xb.binding.ObjectModelFactory;
Modified: trunk/jbossws-core/src/main/resources/samples/common/build-thirdparty.xml
===================================================================
--- trunk/jbossws-core/src/main/resources/samples/common/build-thirdparty.xml 2007-01-05
16:10:32 UTC (rev 1828)
+++ trunk/jbossws-core/src/main/resources/samples/common/build-thirdparty.xml 2007-01-05
21:52:07 UTC (rev 1829)
@@ -24,8 +24,8 @@
description="Gets the thirdparty libraries">
<mkdir dir="${thirdparty.dir}"/>
+ <get
src="${jboss.repository}/apache-logging/${apache-logging}/lib/commons-logging.jar"
dest="${thirdparty.dir}/commons-logging.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/apache-log4j/${apache-log4j}/lib/log4j.jar"
dest="${thirdparty.dir}/log4j.jar" usetimestamp="true"
verbose="true"/>
- <get
src="${jboss.repository}/apache-logging/${apache-logging}/lib/commons-logging.jar"
dest="${thirdparty.dir}/commons-logging.jar" usetimestamp="true"
verbose="true"/>
<get src="${jboss.repository}/ibm-wsdl4j/${ibm-wsdl4j}/lib/wsdl4j.jar"
dest="${thirdparty.dir}/wsdl4j.jar" usetimestamp="true"
verbose="true"/>
<get src="${jboss.repository}/javassist/${javassist}/lib/javassist.jar"
dest="${thirdparty.dir}/javassist.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/common-core/${jboss-common-core}/lib/jboss-common-core.jar"
dest="${thirdparty.dir}/jboss-common-core.jar" usetimestamp="true"
verbose="true"/>
@@ -50,26 +50,32 @@
<target name="thirdparty-classpath">
+ <!-- The thirdparty jars for a jbossws client -->
<path id="client.classpath">
- <fileset dir="${thirdparty.dir}">
- <include name="activation.jar"/>
- <include name="commons-logging.jar"/>
- <include name="concurrent.jar"/>
- <include name="javassist.jar"/>
- <include name="jaxb-api.jar"/>
- <include name="jaxb-impl.jar"/>
- <include name="jboss-common-core.jar"/>
- <include name="jboss-jaxrpc.jar"/>
- <include name="jboss-jaxws.jar"/>
- <include name="jboss-saaj.jar"/>
- <include name="jboss-logging-spi.jar"/>
- <include name="jboss-xml-binding.jar"/>
- <include name="jbossws-client.jar"/>
- <include name="log4j.jar"/>
- <include name="mail.jar"/>
- <include name="wsdl4j.jar"/>
- <include name="xml-apis.jar"/>
- </fileset>
+ <pathelement location="${thirdparty.dir}/activation.jar"/>
+ <pathelement location="${thirdparty.dir}/commons-logging.jar"/>
+ <pathelement location="${thirdparty.dir}/concurrent.jar"/>
+ <pathelement location="${thirdparty.dir}/javassist.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxb-api.jar"/>
+ <pathelement location="${thirdparty.dir}/jaxb-impl.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-common-core.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-container.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-j2ee.jar"/>
+ <pathelement
location="${thirdparty.dir}/jboss-logging-log4j.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-logging-spi.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-remoting.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-security-spi.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-xml-binding.jar"/>
+ <pathelement location="${thirdparty.dir}/log4j.jar"/>
+ <pathelement location="${thirdparty.dir}/mailapi.jar"/>
+ <pathelement location="${thirdparty.dir}/mail.jar"/>
+ <pathelement location="${thirdparty.dir}/wsdl4j.jar"/>
+ <pathelement location="${thirdparty.dir}/xmlsec.jar"/>
+
+ <pathelement location="${thirdparty.dir}/jboss-jaxrpc.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-jaxws.jar"/>
+ <pathelement location="${thirdparty.dir}/jboss-saaj.jar"/>
+ <pathelement location="${thirdparty.dir}/jbossws-client.jar"/>
</path>
<path id="compile.classpath">
Modified: trunk/jbossws-core/src/main/resources/samples/common/imported-build.xml
===================================================================
--- trunk/jbossws-core/src/main/resources/samples/common/imported-build.xml 2007-01-05
16:10:32 UTC (rev 1828)
+++ trunk/jbossws-core/src/main/resources/samples/common/imported-build.xml 2007-01-05
21:52:07 UTC (rev 1829)
@@ -42,6 +42,14 @@
<condition property="jbossws.integration.target.tomcat">
<equals arg1="${jbossws.integration.target}"
arg2="tomcat"/>
</condition>
+
+ <!-- Java Endorsed -->
+ <condition property="endorsed.dirs"
value="${jboss.home}/lib/endorsed">
+ <isset property="jbossws.integration.target.jboss"/>
+ </condition>
+ <condition property="endorsed.dirs"
value="${tomcat.home}/common/endorsed">
+ <isset property="jbossws.integration.target.tomcat"/>
+ </condition>
<!-- Set a hostname property based on COMPUTERNAME for win32, HOSTNAME
otherwise and initialize the node0/node1 cluster hostnames to localhost
@@ -108,11 +116,6 @@
<available property="jboss.available"
file="${jboss.home}/client/jboss-client.jar"/>
<fail message="JBoss not available: ${jboss.home}"
unless="jboss.available"/>
- <!-- Java Endorsed -->
- <condition property="jbossws.endorsed.dirs"
value="${jboss.home}/lib/endorsed">
- <isset property="jbossws.integration.target.jboss"/>
- </condition>
-
<property name="jboss.lib" value="${jboss.home}/lib"/>
<property name="jboss.client"
value="${jboss.home}/client"/>
<property name="jboss.server"
value="${jboss.home}/server/${jboss.server.instance}"/>
@@ -135,9 +138,6 @@
</condition>
<fail message="Tomcat not available: ${tomcat.home}"
if="cannot.use.tomcat"/>
- <!-- Java Endorsed -->
- <property name="jbossws.endorsed.dirs"
value="${tomcat.home}/common/endorsed"/>
-
</target>
<!-- Compile the java sources -->
@@ -220,7 +220,7 @@
<sysproperty key="jbosstest.host.name"
value="${node0}"/>
<sysproperty key="java.naming.provider.url"
value="${node0.jndi.url}"/>
<sysproperty key="log.dir"
value="${build.tests.dir}/log"/>
- <sysproperty key="java.endorsed.dirs"
value="${jbossws.endorsed.dirs}"/>
+ <sysproperty key="java.endorsed.dirs"
value="${endorsed.dirs}"/>
<sysproperty key="jbosstest.server.host"
value="${node0}"/>
<sysproperty key="jbossws.integration.target"
value="${jbossws.integration.target}"/>
<sysproperty key="tomcat.manager.username"
value="${tomcat.manager.username}"/>
@@ -264,7 +264,7 @@
<sysproperty key="jbosstest.host.name"
value="${node0}"/>
<sysproperty key="java.naming.provider.url"
value="${node0.jndi.url}"/>
<sysproperty key="log.dir"
value="${build.tests.dir}/log"/>
- <sysproperty key="java.endorsed.dirs"
value="${jbossws.endorsed.dirs}"/>
+ <sysproperty key="java.endorsed.dirs"
value="${endorsed.dirs}"/>
<sysproperty key="jbosstest.server.host"
value="${node0}"/>
<sysproperty key="jbossws.integration.target"
value="${jbossws.integration.target}"/>
<sysproperty key="tomcat.manager.username"
value="${tomcat.manager.username}"/>