diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-07-14 13:39:00 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-07-14 13:39:00 +0000 |
commit | f1f12d88cb6637d4273a53012170d855581a7f64 (patch) | |
tree | 896af1a45ad40dba5451e94bceb3937357d2767e /sca-java-2.x/trunk | |
parent | fcddd63a5786ca1351de3d838d5559a8e232c2b9 (diff) |
Be more precise about when the async response path should be connected up in the service binding wire.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1146705 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r-- | sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java index 6790f3b870..9248d35db3 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java @@ -664,34 +664,23 @@ public class RuntimeEndpointImpl extends EndpointImpl implements RuntimeEndpoint // This is strategically placed before the RuntimeInvoker is added to the end of the // binding chain as the RuntimeInvoker doesn't need to take part in the response // processing and doesn't implement InvokerAsyncResponse - if (isAsyncInvocation()){ + ServiceBindingProvider serviceBindingProvider = getBindingProvider(); + if (isAsyncInvocation() && + serviceBindingProvider instanceof EndpointAsyncProvider && + ((EndpointAsyncProvider)serviceBindingProvider).supportsNativeAsync()){ // fix up the invocation chains to point back to the // binding chain so that async response messages // are processed correctly for (InvocationChain chain : getInvocationChains()){ Invoker invoker = chain.getHeadInvoker(); - if (invoker instanceof InterceptorAsync){ - ((InterceptorAsync)invoker).setPrevious((InvokerAsyncResponse)bindingInvocationChain.getTailInvoker()); - } else { - // TODO - raise an error. Not doing that while - // we have the old async mechanism in play - } + ((InterceptorAsync)invoker).setPrevious((InvokerAsyncResponse)bindingInvocationChain.getTailInvoker()); } // end for // fix up the binding chain response path to point back to the // binding provided async response handler - ServiceBindingProvider serviceBindingProvider = getBindingProvider(); - if (serviceBindingProvider instanceof EndpointAsyncProvider){ - EndpointAsyncProvider asyncEndpointProvider = (EndpointAsyncProvider)serviceBindingProvider; - InvokerAsyncResponse asyncResponseInvoker = asyncEndpointProvider.createAsyncResponseInvoker(); - if (bindingInvocationChain.getHeadInvoker() instanceof InterceptorAsync){ - ((InterceptorAsync)bindingInvocationChain.getHeadInvoker()).setPrevious(asyncResponseInvoker); - } else { - //TODO - throw error once the old async code is removed - } - } else { - //TODO - throw error once the old async code is removed - } // end if + EndpointAsyncProvider asyncEndpointProvider = (EndpointAsyncProvider)serviceBindingProvider; + InvokerAsyncResponse asyncResponseInvoker = asyncEndpointProvider.createAsyncResponseInvoker(); + ((InterceptorAsync)bindingInvocationChain.getHeadInvoker()).setPrevious(asyncResponseInvoker); } // end if // Add the runtime invoker to the end of the binding chain. |