From d8ee917baedd855ab2b320c2cb3136641e586a1b Mon Sep 17 00:00:00 2001 From: antelder Date: Fri, 8 Aug 2008 11:18:24 +0000 Subject: TUSCANY-2514: make tuscany-host-{tomcat,jetty} optional for binding.ws clients git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@683939 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java | 7 ++----- .../sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java | 3 +-- .../tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java | 4 ++++ .../apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java | 2 -- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java index eb5f01a70b..c7eb2b7794 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingProviderFactory.java @@ -52,9 +52,7 @@ public class Axis2BindingProviderFactory implements BindingProviderFactory hosts = servletHosts.getServletHosts(); - if (hosts.isEmpty()) { - throw new ServiceRuntimeException("No Servlet host is avaible for HTTP web services"); - } else { + if (!hosts.isEmpty()) { this.servletHost = hosts.get(0); } modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); @@ -66,8 +64,7 @@ public class Axis2BindingProviderFactory implements BindingProviderFactory policyHandlerClassnames, DataBindingExtensionPoint dataBindings) { @@ -62,7 +61,7 @@ public class Axis2ReferenceBindingProvider implements ReferenceBindingProvider { contract.getInterface().resetDataBinding(OMElement.class.getName()); } - axisClient = new Axis2ServiceClient(component, reference, wsBinding, servletHost, messageFactory, policyHandlerClassnames); + axisClient = new Axis2ServiceClient(component, reference, wsBinding, messageFactory, policyHandlerClassnames); } public void start() { diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java index 3bdf33ea28..5b26290732 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceBindingProvider.java @@ -46,6 +46,10 @@ public class Axis2ServiceBindingProvider implements ServiceBindingProvider { List policyHandlerClassnames, DataBindingExtensionPoint dataBindings) { + if (servletHost == null) { + throw new ServiceRuntimeException("No Servlet host is avaible for HTTP web services"); + } + MessageFactory messageFactory = modelFactories.getFactory(MessageFactory.class); this.wsBinding = wsBinding; diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java index d81aaf374c..7df88a6b1f 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java @@ -69,7 +69,6 @@ import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; import org.apache.commons.httpclient.params.HttpConnectionManagerParams; import org.apache.tuscany.sca.assembly.AbstractContract; import org.apache.tuscany.sca.binding.ws.WebServiceBinding; -import org.apache.tuscany.sca.host.http.ServletHost; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.invocation.MessageFactory; @@ -96,7 +95,6 @@ public class Axis2ServiceClient { public Axis2ServiceClient(RuntimeComponent component, AbstractContract contract, WebServiceBinding wsBinding, - ServletHost servletHost, MessageFactory messageFactory, List policyHandlerClassnames) { -- cgit v1.2.3