diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache')
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); + } } /** |