summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core/src
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-03-11 15:42:08 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-03-11 15:42:08 +0000
commit80a7a00fc58f32cd4c6a378cb9d861f65c4802c1 (patch)
treeaa49d1317ac899a24fb9b245ba547f2a86364eda /sca-java-2.x/trunk/modules/core/src
parentb12d2f6eeef04727ea874a24e5b3217ff3e4e649 (diff)
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
Diffstat (limited to 'sca-java-2.x/trunk/modules/core/src')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java17
1 files changed, 15 insertions, 2 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 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<Intent> 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