Author: antelder
Date: Fri Sep  7 10:00:21 2012
New Revision: 1381971

URL: http://svn.apache.org/viewvc?rev=1381971&view=rev
Log:
TUSCANY-4069: Apply patch from Rashmi Hunt to fix Issue with resolving 
autowired reference when binding is not defined to a target service exposed 
over multiple bindings

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=1381971&r1=1381970&r2=1381971&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 Sep  7 10:00:21 2012
@@ -493,6 +493,16 @@ public class EndpointReferenceBinderImpl
                     }
                 }
             } 
+            
+            // TUSCANY-4069 if no binding specified on reference then use 
service binding.sca if that exists 
+            if (endpointReference.getBinding() == null && 
endpointReference.getReference().getAutowire() == true){
+                for (Endpoint endpoint : matchedEndpoints){
+                    if (endpoint.getBinding() instanceof SCABinding){
+                        matchedEndpoint = endpoint;
+                        break;
+                    }
+                }
+            } 
 
             if (matchedEndpoint == null) {
                 // just take the first matched endpoint from the list


Reply via email to