diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-08 11:18:24 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-08 11:18:24 +0000 |
commit | d8ee917baedd855ab2b320c2cb3136641e586a1b (patch) | |
tree | d50a19f97512b02712b659f83c75e60310ab4237 /java/sca/modules | |
parent | c4d8b9d21959e1d5765bf4db44ecb40f5d9fa66c (diff) |
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
Diffstat (limited to 'java/sca/modules')
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<WebSe public Axis2BindingProviderFactory(ExtensionPointRegistry extensionPoints) { ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class); List<ServletHost> 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<WebSe RuntimeComponentReference reference, WebServiceBinding binding) { return new Axis2ReferenceBindingProvider(component, reference, binding, - servletHost, modelFactories, - policyHandlerClassnames, dataBindings); + modelFactories, policyHandlerClassnames, dataBindings); } public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java index 8f8cb5f392..958d4aa41d 100644 --- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java +++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ReferenceBindingProvider.java @@ -43,7 +43,6 @@ public class Axis2ReferenceBindingProvider implements ReferenceBindingProvider { public Axis2ReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference, WebServiceBinding wsBinding, - ServletHost servletHost, ModelFactoryExtensionPoint modelFactories, List<PolicyHandlerTuple> 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<PolicyHandlerTuple> 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<PolicyHandlerTuple> policyHandlerClassnames) { |