From 80a7a00fc58f32cd4c6a378cb9d861f65c4802c1 Mon Sep 17 00:00:00 2001 From: slaws Date: Thu, 11 Mar 2010 15:42:08 +0000 Subject: TUSCANY-3483 - ensure that policies defined in the implementation are applied correctly to the component service. This pointed out another problem in that if binding.sca was defined on the reference with no uri but with intents then the intents weren't being applied to the EPR because the binding was being ignored (as it's a targeted reference). git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@921903 13f79535-47bb-0310-9956-ffa450edef68 --- .../core/runtime/impl/EndpointReferenceBinderImpl.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'sca-java-2.x/trunk/modules/core/src') 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 e72a9f2e35..8eade75a8c 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 @@ -408,7 +408,9 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { for (Intent eprIntent : endpointReference.getRequiredIntents()){ for (Intent epIntent : endpoint.getRequiredIntents()){ if (eprIntent.getExcludedIntents().contains(epIntent) || - epIntent.getExcludedIntents().contains(eprIntent)){ + epIntent.getExcludedIntents().contains(eprIntent) || + checkQualifiedMutualExclusion(eprIntent.getExcludedIntents(), epIntent) || + checkQualifiedMutualExclusion(epIntent.getExcludedIntents(), eprIntent)){ matchAudit.append("No match because the following intents are mutually exclusive " + eprIntent.toString() + " " + @@ -622,7 +624,18 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { } else { return false; } - } + } + + protected boolean checkQualifiedMutualExclusion(List excludedIntentList, Intent intent){ + for (Intent excludedIntent : excludedIntentList){ + if (intent.getQualifiableIntent() != null && + excludedIntent != null && + intent.getQualifiableIntent().equals(excludedIntent)){ + return true; + } + } + return false; + } /** * Determine if endpoint reference and endpoint interface contracts match -- cgit v1.2.3