From a16f36a53eaefe3e6f60df7537baecb2ab6f9a11 Mon Sep 17 00:00:00 2001 From: rfeng Date: Wed, 21 Mar 2012 21:49:52 +0000 Subject: Revert the change based on the comment from https://issues.apache.org/jira/browse/TUSCANY-4029 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1303591 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/core/runtime/impl/EndpointReferenceBinderImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java') 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 d3f20320ac..0a504d4dba 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 @@ -338,6 +338,11 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { } + // [rfeng] Setup the target endpoint if the reference uses an explicit binding + if (endpointReference.getTargetEndpoint().getBinding() == null) { + endpointReference.getTargetEndpoint().setBinding(endpointReference.getBinding()); + } + // Now the endpoint reference is resolved check that the binding interfaces contract // and the reference contract are compatible try { @@ -500,12 +505,16 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { } else { endpointReference.setTargetEndpoint(matchedEndpoint); Binding binding = matchedEndpoint.getBinding(); + // Reverted the change, see https://issues.apache.org/jira/browse/TUSCANY-4029 + /* try { endpointReference.setBinding((Binding) binding.clone()); } catch (CloneNotSupportedException e) { // shouldn't happen throw new RuntimeException(e); } + */ + endpointReference.setBinding(binding); // TUSCANY-3873 - add policy from the service // we don't care about intents at this stage endpointReference.getPolicySets().addAll(matchedEndpoint.getPolicySets()); @@ -528,6 +537,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { endpointReference.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED); endpointReference.setUnresolved(false); } + } private void build(EndpointReference endpointReference) { -- cgit v1.2.3