diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-24 10:31:23 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-24 10:31:23 +0000 |
commit | a88bb82a47575abb4a143b799c3340b5dd39850a (patch) | |
tree | 2e7c4a18cb47e90fc8f81d4cc3ac75a319f49a29 /java/sca/modules | |
parent | dc4c810d627c0392a46ed4a6f7b36fbe8a2f50bf (diff) |
Update jsonp binding for recent provider api changes
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@787969 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
2 files changed, 17 insertions, 24 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 7c7a827571..0954935098 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,6 +21,8 @@ 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;
@@ -28,9 +30,6 @@ 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.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
public class JSONPBindingProviderFactory implements BindingProviderFactory<JSONPBinding> {
@@ -44,20 +43,17 @@ public class JSONPBindingProviderFactory implements BindingProviderFactory<JSONP }
}
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
- RuntimeComponentReference reference,
- JSONPBinding binding) {
- return null;
+ public Class<JSONPBinding> getModelType() {
+ return JSONPBinding.class;
}
- public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- JSONPBinding binding) {
- return new JSONPServiceBindingProvider(component, service, binding, servletHost);
+ public ReferenceBindingProvider createReferenceBindingProvider(EndpointReference arg0) {
+ // TODO Auto-generated method stub
+ return null;
}
- public Class<JSONPBinding> getModelType() {
- return JSONPBinding.class;
+ public ServiceBindingProvider createServiceBindingProvider(Endpoint 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 25f1d8cc51..dfd2faef7f 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 @@ -19,33 +19,29 @@ package org.apache.tuscany.sca.binding.jsonp.runtime;
-import org.apache.tuscany.sca.binding.jsonp.JSONPBinding;
+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.RuntimeComponent;
import org.apache.tuscany.sca.runtime.RuntimeComponentService;
import org.apache.tuscany.sca.runtime.RuntimeWire;
public class JSONPServiceBindingProvider implements ServiceBindingProvider {
- private RuntimeComponentService service;
- private JSONPBinding binding;
+ private Endpoint endpoint;
private ServletHost servletHost;
- public JSONPServiceBindingProvider(RuntimeComponent component,
- RuntimeComponentService service,
- JSONPBinding binding,
- ServletHost servletHost) {
- this.service = service;
- this.binding = binding;
+ public JSONPServiceBindingProvider(Endpoint endpoint, ServletHost servletHost) {
+ this.endpoint = endpoint;
this.servletHost = servletHost;
}
public void start() {
- RuntimeWire wire = service.getRuntimeWire(binding);
+ 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);
@@ -55,6 +51,7 @@ public class JSONPServiceBindingProvider implements ServiceBindingProvider { }
public void stop() {
+ ComponentService service = endpoint.getService();
Interface serviceInterface = service.getInterfaceContract().getInterface();
for (Operation op : serviceInterface.getOperations()) {
String path = service.getName() + "/" + op.getName();
|