From 3b7a9c51b93925c567b6b84450410b2737cc565e Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 16 Feb 2012 15:41:20 +0000 Subject: Delete old RC tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1245037 13f79535-47bb-0310-9956-ffa450edef68 --- .../ws/jaxws/ri/JAXWSBindingProviderFactory.java | 77 ----------- .../ws/jaxws/ri/JAXWSReferenceBindingProvider.java | 77 ----------- .../ws/jaxws/ri/JAXWSServiceBindingProvider.java | 144 --------------------- 3 files changed, 298 deletions(-) delete mode 100644 sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSBindingProviderFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSReferenceBindingProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java (limited to 'sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding') diff --git a/sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSBindingProviderFactory.java b/sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSBindingProviderFactory.java deleted file mode 100644 index 45463fcd53..0000000000 --- a/sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSBindingProviderFactory.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.ws.jaxws.ri; - -import java.util.List; - -import org.apache.tuscany.sca.binding.ws.WebServiceBinding; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.FactoryExtensionPoint; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.host.http.ServletHost; -import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint; -import org.apache.tuscany.sca.provider.BindingProviderFactory; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; -import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; -import org.apache.tuscany.sca.runtime.RuntimeProperties; - -/** - * JAXWSBindingProviderFactory - * - * @version $Rev$ $Date$ - */ - -public class JAXWSBindingProviderFactory implements BindingProviderFactory { - - private FactoryExtensionPoint modelFactories; - private ServletHost servletHost; - private DataBindingExtensionPoint dataBindings; - private String defaultPort = "8085"; - - public JAXWSBindingProviderFactory(ExtensionPointRegistry extensionPoints) { - ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class); - List hosts = servletHosts.getServletHosts(); - if (!hosts.isEmpty()) { - this.servletHost = hosts.get(0); - } - modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); - dataBindings = extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class); - - RuntimeProperties ps = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class); - String pp = ps.getProperties().getProperty(this.getClass().getName() + ".defaultPort"); - if (pp != null) { - this.defaultPort = ps.getProperties().getProperty(this.getClass().getName() + ".defaultPort"); - } - } - - public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpointReference) { - return new JAXWSReferenceBindingProvider(endpointReference, modelFactories, dataBindings); - } - - public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) { - return new JAXWSServiceBindingProvider(endpoint, servletHost, modelFactories, dataBindings, defaultPort); - } - - public Class getModelType() { - return WebServiceBinding.class; - } -} diff --git a/sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSReferenceBindingProvider.java b/sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSReferenceBindingProvider.java deleted file mode 100644 index 7a1b8f356a..0000000000 --- a/sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSReferenceBindingProvider.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.ws.jaxws.ri; - -import org.apache.tuscany.sca.binding.ws.WebServiceBinding; -import org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker; -import org.apache.tuscany.sca.core.FactoryExtensionPoint; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; -import org.oasisopen.sca.ServiceRuntimeException; -import org.w3c.dom.Node; - -public class JAXWSReferenceBindingProvider implements ReferenceBindingProvider { - - private javax.xml.soap.MessageFactory messageFactory; - private WebServiceBinding wsBinding; - private RuntimeEndpointReference endpointReference; - - public JAXWSReferenceBindingProvider(RuntimeEndpointReference endpointReference, - FactoryExtensionPoint modelFactories, - DataBindingExtensionPoint dataBindings) { - - this.endpointReference = endpointReference; - this.messageFactory = modelFactories.getFactory(javax.xml.soap.MessageFactory.class); - this.wsBinding = (WebServiceBinding) endpointReference.getBinding(); - - // A WSDL document should always be present in the binding - if (wsBinding.getGeneratedWSDLDocument() == null) { - throw new ServiceRuntimeException("No WSDL document for " + endpointReference.getURI()); - } - - // Set to use the DOM data binding - InterfaceContract contract = wsBinding.getBindingInterfaceContract(); - if (contract.getInterface() != null) { - contract.getInterface().resetDataBinding(Node.class.getName()); - } - } - - public void start() { - } - - public void stop() { - } - - public InterfaceContract getBindingInterfaceContract() { - return wsBinding.getBindingInterfaceContract(); - } - - public boolean supportsOneWayInvocation() { - return true; - } - - public Invoker createInvoker(Operation operation) { - return new JAXWSBindingInvoker(operation, null, messageFactory, wsBinding, endpointReference); - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java b/sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java deleted file mode 100644 index 91d4bca7c0..0000000000 --- a/sca-java-2.x/tags/2.0-Beta1-RC1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.ws.jaxws.ri; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLWriter; -import javax.xml.namespace.QName; -import javax.xml.transform.Source; -import javax.xml.transform.stream.StreamSource; -import javax.xml.ws.Endpoint; -import javax.xml.ws.ServiceMode; -import javax.xml.ws.WebServiceProvider; -import javax.xml.ws.Service.Mode; -import javax.xml.ws.soap.SOAPBinding; - -import org.apache.tuscany.sca.binding.ws.WebServiceBinding; -import org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider; -import org.apache.tuscany.sca.core.FactoryExtensionPoint; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.host.http.ServletHost; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; - -@WebServiceProvider -@ServiceMode(Mode.MESSAGE) -public class JAXWSServiceBindingProvider implements ServiceBindingProvider { - - private RuntimeEndpoint endpoint; - private WebServiceBinding wsBinding; - - private JAXWSBindingProvider jaxwsBindingProvider; - - private Endpoint wsEndpoint; - - public JAXWSServiceBindingProvider(RuntimeEndpoint endpoint, - ServletHost servletHost, - FactoryExtensionPoint modelFactories, - DataBindingExtensionPoint dataBindings, String defaultPort) { - - this.endpoint = endpoint; - this.wsBinding = (WebServiceBinding)endpoint.getBinding(); - - jaxwsBindingProvider = new JAXWSBindingProvider(endpoint, - servletHost, - modelFactories, - dataBindings, - defaultPort); - } - - public void start() { - // create the JAXWS endpoint based on the provider - wsEndpoint = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, jaxwsBindingProvider); - - // TODO - There is something odd in the way that service name is calculated in - // some circumstances - // sometimes getServiceName() returns null - // sometimes getService().getQName returns a QName namespace that doesn't match the WSDL - // sometimes getNamespace() returns null - // So here we delve directly into the WSDL4J model as the Tuscany model isn't up to date - String targetNamespace = wsBinding.getUserSpecifiedWSDLDefinition().getDefinition().getTargetNamespace(); - - //set up WSDL for Provider - List metadata = new ArrayList(); - - // WSDL DOM seems to be null here so went with writing out - // string version of WSDL and reading it back in again - //Node node = wsBinding.getWSDLDefinition().getDefinition().getDocumentationElement(); - //Source source = new DOMSource(node); - - ByteArrayOutputStream outStream = new ByteArrayOutputStream(); - try { - WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter(); - writer.writeWSDL(wsBinding.getUserSpecifiedWSDLDefinition().getDefinition(), outStream); - } catch (Exception ex){ - ex.printStackTrace(); - } - - //System.out.println(outStream.toString()); - ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray()); - Source source = new StreamSource(inStream); - source.setSystemId(targetNamespace); - - metadata.add(source); - - Map properties = new HashMap(); - - QName portName = new QName(targetNamespace, - wsBinding.getPort().getName()); - properties.put(Endpoint.WSDL_PORT, portName); - - QName bindingServiceName = wsBinding.getServiceName() == null ? wsBinding.getService().getQName() : wsBinding.getServiceName(); - QName serviceName = new QName(targetNamespace, - bindingServiceName.getLocalPart()); - properties.put(Endpoint.WSDL_SERVICE, serviceName); - - wsEndpoint.setMetadata(metadata); - wsEndpoint.setProperties(properties); - - // Start up the endpoint - - wsEndpoint.publish(wsBinding.getURI()); - - - jaxwsBindingProvider.start(); - - } - - public void stop() { - jaxwsBindingProvider.stop(); - wsEndpoint.stop(); - } - - public InterfaceContract getBindingInterfaceContract() { - return wsBinding.getBindingInterfaceContract(); - } - - public boolean supportsOneWayInvocation() { - return true; - } -} -- cgit v1.2.3