diff options
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.java | 15 |
1 files changed, 14 insertions, 1 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 2a3e466b60..179c60a829 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 @@ -413,9 +413,22 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { } } else { // find the first endpoint that matches this endpoint reference + boolean findTargetSCABinding = false; + + // TUSCANY-3941 check for the case where the user has provided a + // binding.sca at the reference and make sure we pick + // a binding.sca at the service regardless of how many + // other bindings are provided + if (endpointReference.getBinding() != null && + endpointReference.getBinding() instanceof SCABinding ){ + findTargetSCABinding = true; + } + for (Endpoint endpoint : endpoints){ if (haveMatchingPolicy(endpointReference, endpoint, matchAudit, builderContext) && - haveMatchingInterfaceContracts(endpointReference, endpoint, matchAudit)){ + haveMatchingInterfaceContracts(endpointReference, endpoint, matchAudit) && + (findTargetSCABinding == false || + (findTargetSCABinding == true && endpoint.getBinding() instanceof SCABinding))){ matchedEndpoint = endpoint; break; } |