tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r1041872 - /tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
Date Fri, 03 Dec 2010 15:27:00 GMT
Author: slaws
Date: Fri Dec  3 15:26:59 2010
New Revision: 1041872

URL: http://svn.apache.org/viewvc?rev=1041872&view=rev
Log:
TUSCANY-3801 - only create a service to accept async responses if the binding doesn't support
asycn interactions natively

Modified:
    tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java

Modified: tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java?rev=1041872&r1=1041871&r2=1041872&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
Fri Dec  3 15:26:59 2010
@@ -55,6 +55,8 @@ import org.apache.tuscany.sca.policy.Int
 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
             }
         }
         
-        // 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();
         }
     



Mime
View raw message