commit | 517ca3096a4003f24601c7f1ed2d62a3954bf551 | [log] [tgz] |
---|---|---|
author | Anthony Elder <antelder@apache.org> | Fri Sep 07 10:00:21 2012 +0000 |
committer | Anthony Elder <antelder@apache.org> | Fri Sep 07 10:00:21 2012 +0000 |
tree | f27d80d6ef0ab9484557e1476e3c3ab4e13a9bf3 | |
parent | 54501e00db06781613e17cc786b86a824f3d920e [diff] |
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 git-svn-id: https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk@1381971 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java index 647cd12..4ce163f 100644 --- a/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java +++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
@@ -493,6 +493,16 @@ } } } + + // 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