diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-06-25 14:29:31 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-06-25 14:29:31 +0000 |
commit | 0fb0a8321f7af39c8ecdcf52b1d4572b05e4c19d (patch) | |
tree | 4339cb5a5d2fd6e5fdd73085b961888995a4b054 /sca-java-2.x/contrib/modules/binding-ws-runtime-jaxws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/axis2/JAXWSServiceBindingProvider.java | |
parent | 352c1b8260ea446683bbcc304d700fc2a0d03d44 (diff) |
connecting the JAXWS provider to the Tuscany chain. Pointed out an interesting thing that should have been obvious but which I didn't notice before. The MessageContext coming from a JAXWSProvider is a JAXWS MessageContext and we are expecting an Axis MessageContext in our existing code.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@957987 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/contrib/modules/binding-ws-runtime-jaxws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/axis2/JAXWSServiceBindingProvider.java | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/sca-java-2.x/contrib/modules/binding-ws-runtime-jaxws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/axis2/JAXWSServiceBindingProvider.java b/sca-java-2.x/contrib/modules/binding-ws-runtime-jaxws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/axis2/JAXWSServiceBindingProvider.java index 94cd1d621d..fe05a45ecf 100644 --- a/sca-java-2.x/contrib/modules/binding-ws-runtime-jaxws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/axis2/JAXWSServiceBindingProvider.java +++ b/sca-java-2.x/contrib/modules/binding-ws-runtime-jaxws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/axis2/JAXWSServiceBindingProvider.java @@ -22,6 +22,7 @@ import java.net.URI; import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.wsdl.Port;
import javax.xml.ws.Binding;
@@ -49,6 +50,7 @@ import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
import org.apache.tuscany.sca.host.http.SecurityContext;
import org.apache.tuscany.sca.host.http.ServletHost;
+import org.apache.tuscany.sca.interfacedef.Interface;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.invocation.MessageFactory;
@@ -61,6 +63,8 @@ import org.oasisopen.sca.ServiceRuntimeException; public class JAXWSServiceBindingProvider implements ServiceBindingProvider {
+ private static Map<String, WSProvider> providerCache = new HashMap<String, WSProvider>();
+
// Tuscany extensions
private ExtensionPointRegistry extensionPoints;
private ServletHost servletHost;
@@ -77,7 +81,6 @@ public class JAXWSServiceBindingProvider implements ServiceBindingProvider { protected SecurityContext httpSecurityContext;
// JAXWS fields
- private JAXWSBindingProvider jaxwsBindingProvider;
private Endpoint wsEndpoint;
// Axis2 fields
@@ -146,27 +149,23 @@ public class JAXWSServiceBindingProvider implements ServiceBindingProvider { if (pp != null) {
defaultPort = ps.getProperties().getProperty(this.getClass().getName() + ".defaultPort");
}
- // ========
-/*
- jaxwsBindingProvider = new JAXWSBindingProvider(endpoint,
- servletHost,
- modelFactories,
- dataBindings,
- defaultPort);
-*/
- jaxwsBindingProvider = new JAXWSBindingProvider();
-
+ // ========
+
// get the Axis configuration context
configContext = Axis2EngineIntegration.getAxisConfigurationContext(extensionPoints.getServiceDiscovery());
//configContext.setContextRoot(servletHost.getContextPath());
configContext.setContextRoot("http://localhost:8085");
}
+ public static Map<String, WSProvider> getProviderCache(){
+ return providerCache;
+ }
+
public void start() {
// experiment in how to install a JAXWS provider into Axis2 programatically
try {
// create the service description
- JavaClassToDBCConverter converter = new JavaClassToDBCConverter(jaxwsBindingProvider.getClass());
+ JavaClassToDBCConverter converter = new JavaClassToDBCConverter(JAXWSProvider.class);
HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
// Set the details of the service we are going to expose through this provider
@@ -212,6 +211,15 @@ public class JAXWSServiceBindingProvider implements ServiceBindingProvider { configContext.getAxisConfiguration().addService(axisService);
+ Interface iface = wsBinding.getBindingInterfaceContract().getInterface();
+ for (Operation operation : iface.getOperations()) {
+ WSProvider wsProvider = new WSProvider(extensionPoints,
+ endpoint,
+ wsBinding,
+ operation);
+ providerCache.put(operation.getName(), wsProvider);
+ }
+
// fire up the Axis servlet
Axis2ServiceServlet servlet = new Axis2ServiceServlet();
servlet.init(configContext);
@@ -221,6 +229,7 @@ public class JAXWSServiceBindingProvider implements ServiceBindingProvider { ex.printStackTrace();
}
}
+
/*
public void start() {
// experiment in how to install a JAXWS provider into Axis programatically starting
|