diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-13 21:49:15 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-13 21:49:15 +0000 |
commit | 4dcff7533534e4b634b349a1105c7862d1655405 (patch) | |
tree | 61674abfb88ba63870bec8576101dc3d222454fa /java/sca/modules/binding-jsonp-runtime/src | |
parent | c6a1c369e49090b6b9a6f2448045740a368c7ca3 (diff) |
Replace RuntimeWire with RuntimeEnpoint/RuntimeEndpointReference as the owner of invocaiton chains
(http://www.mail-archive.com/dev@tuscany.apache.org/msg07856.html)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@836009 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-jsonp-runtime/src')
3 files changed, 11 insertions, 14 deletions
diff --git a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPBindingProviderFactory.java b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPBindingProviderFactory.java index 90daedb647..fa5afa0189 100644 --- a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPBindingProviderFactory.java +++ b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPBindingProviderFactory.java @@ -21,8 +21,6 @@ package org.apache.tuscany.sca.binding.jsonp.runtime; import java.util.List; -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.binding.jsonp.JSONPBinding; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.host.http.ServletHost; @@ -30,6 +28,8 @@ 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; public class JSONPBindingProviderFactory implements BindingProviderFactory<JSONPBinding> { @@ -47,11 +47,11 @@ public class JSONPBindingProviderFactory implements BindingProviderFactory<JSONP return JSONPBinding.class; } - public ReferenceBindingProvider createReferenceBindingProvider(EndpointReference endpoint) { + public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpoint) { return new JSONPReferenceBindingProvider(endpoint); } - public ServiceBindingProvider createServiceBindingProvider(Endpoint endpoint) { + public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) { return new JSONPServiceBindingProvider(endpoint, servletHost); } diff --git a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java index 4257cc72e2..4e3f7321af 100644 --- a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java +++ b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java @@ -20,31 +20,28 @@ package org.apache.tuscany.sca.binding.jsonp.runtime; import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Endpoint; 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.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; -import org.apache.tuscany.sca.runtime.RuntimeWire; +import org.apache.tuscany.sca.runtime.RuntimeEndpoint; public class JSONPServiceBindingProvider implements ServiceBindingProvider { - private Endpoint endpoint; + private RuntimeEndpoint endpoint; private ServletHost servletHost; - public JSONPServiceBindingProvider(Endpoint endpoint, ServletHost servletHost) { + public JSONPServiceBindingProvider(RuntimeEndpoint endpoint, ServletHost servletHost) { this.endpoint = endpoint; this.servletHost = servletHost; } public void start() { ComponentService service = endpoint.getService(); - RuntimeWire wire = ((RuntimeComponentService)service).getRuntimeWire(endpoint.getBinding()); Interface serviceInterface = service.getInterfaceContract().getInterface(); for (Operation op : serviceInterface.getOperations()) { - JSONPServlet servlet = new JSONPServlet(wire, op); + JSONPServlet servlet = new JSONPServlet(endpoint, op); String path = endpoint.getBinding().getURI() + "/" + op.getName(); servletHost.addServletMapping(path, servlet); } diff --git a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java index edacc2d374..b782875948 100644 --- a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java +++ b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java @@ -36,7 +36,7 @@ import javax.servlet.http.HttpServletRequest; import org.apache.tuscany.sca.interfacedef.DataType; import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.runtime.RuntimeWire; +import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; @@ -44,11 +44,11 @@ import org.codehaus.jackson.map.ObjectMapper; public class JSONPServlet extends GenericServlet { private static final long serialVersionUID = 1L; - protected transient RuntimeWire wire; + protected transient RuntimeEndpoint wire; protected transient Operation operation; protected transient ObjectMapper mapper; - public JSONPServlet(RuntimeWire wire, Operation operation) { + public JSONPServlet(RuntimeEndpoint wire, Operation operation) { this.wire = wire; this.operation = operation; this.mapper = new ObjectMapper(); |