diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-25 13:50:45 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-25 13:50:45 +0000 |
commit | 1456632c03944d54a5f059fe54e49b3014bc7fea (patch) | |
tree | ddbe2de805d1af6e2f0e2153d3aa1b491e94f9f2 | |
parent | ee19b7b16732bdccc30501d4e77725894db95646 (diff) |
Delegate the creation of the response invoker if there is a delegate present.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1063280 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
2 files changed, 36 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DelegatingSCAServiceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DelegatingSCAServiceBindingProvider.java index ca90878633..ea888f4f8e 100644 --- a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DelegatingSCAServiceBindingProvider.java +++ b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DelegatingSCAServiceBindingProvider.java @@ -22,6 +22,9 @@ package org.apache.tuscany.sca.binding.sca.provider; import java.util.logging.Logger; import org.apache.tuscany.sca.interfacedef.InterfaceContract; +import org.apache.tuscany.sca.invocation.InvokerAsyncResponse; +import org.apache.tuscany.sca.provider.EndpointAsyncProvider; +import org.apache.tuscany.sca.provider.EndpointProvider; import org.apache.tuscany.sca.provider.ServiceBindingProvider; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; @@ -31,7 +34,7 @@ import org.apache.tuscany.sca.runtime.RuntimeEndpoint; * * @version $Rev$ $Date$ */ -public class DelegatingSCAServiceBindingProvider implements ServiceBindingProvider { +public class DelegatingSCAServiceBindingProvider implements EndpointAsyncProvider { private static final Logger logger = Logger.getLogger(DelegatingSCAServiceBindingProvider.class.getName()); @@ -49,13 +52,40 @@ public class DelegatingSCAServiceBindingProvider implements ServiceBindingProvid } + @Override public InterfaceContract getBindingInterfaceContract() { return provider.getBindingInterfaceContract(); } + @Override public boolean supportsOneWayInvocation() { return provider.supportsOneWayInvocation(); } + + @Override + public void configure() { + if (provider instanceof EndpointProvider){ + ((EndpointProvider)provider).configure(); + } + } + + @Override + public boolean supportsNativeAsync() { + if (provider instanceof EndpointAsyncProvider){ + return ((EndpointAsyncProvider)provider).supportsNativeAsync(); + } else { + return false; + } + } + + @Override + public InvokerAsyncResponse createAsyncResponseInvoker() { + if (provider instanceof EndpointAsyncProvider){ + return ((EndpointAsyncProvider)provider).createAsyncResponseInvoker(); + } else { + return null; + } + } public void start() { if (started) { diff --git a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java index f5745f75e3..77a7e308dd 100644 --- a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java +++ b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAServiceBindingProvider.java @@ -115,7 +115,11 @@ public class RuntimeSCAServiceBindingProvider implements EndpointAsyncProvider, } public InvokerAsyncResponse createAsyncResponseInvoker() { - return new SCABindingAsyncResponseInvoker(null, null); + if (distributedProvider != null) { + return ((EndpointAsyncProvider)distributedProvider).createAsyncResponseInvoker(); + } else { + return new SCABindingAsyncResponseInvoker(null, null); + } } /** |