summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-12-03 15:26:59 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-12-03 15:26:59 +0000
commit2a01b51663d1cc51eee4850e21803656e221e894 (patch)
treee72873a71b1d24efc6fb463cb397cbebbc86937c /sca-java-2.x/trunk/modules/core
parentc491a139355186f4adb370926071a3f983596965 (diff)
TUSCANY-3801 - only create a service to accept async responses if the binding doesn't support asycn interactions natively
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1041872 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
index ffe48005ea..67455bad09 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
@@ -55,6 +55,8 @@ import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.IntentMap;
import org.apache.tuscany.sca.policy.PolicySet;
import org.apache.tuscany.sca.policy.Qualifier;
+import org.apache.tuscany.sca.provider.EndpointReferenceAsyncProvider;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
import org.apache.tuscany.sca.runtime.CompositeActivator;
import org.apache.tuscany.sca.runtime.EndpointReferenceBinder;
import org.apache.tuscany.sca.runtime.EndpointRegistry;
@@ -330,9 +332,14 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
}
}
- // if the reference is an async reference fluff up the
- // response service/endpoint
- if (endpointReference.isAsyncInvocation()){
+ // TUSCANY-3783
+ // if the reference is an async reference and the binding doesn't support
+ // async natively fluff up the response service/endpoint
+ ReferenceBindingProvider referenceBindingProvider = ((RuntimeEndpointReference)endpointReference).getBindingProvider();
+ if ( referenceBindingProvider instanceof EndpointReferenceAsyncProvider &&
+ !((EndpointReferenceAsyncProvider)referenceBindingProvider).supportsNativeAsync() &&
+ endpointReference.isAsyncInvocation() &&
+ endpointReference.getCallbackEndpoint() == null) {
((RuntimeEndpointReference)endpointReference).createAsyncCallbackEndpoint();
}