diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca')
-rw-r--r-- | sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java | 31 |
1 files changed, 30 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 dc007c6a07..a8b8b0691f 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 @@ -43,7 +43,9 @@ import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.MonitorFactory; import org.apache.tuscany.sca.policy.Intent; +import org.apache.tuscany.sca.policy.IntentMap; import org.apache.tuscany.sca.policy.PolicySet; +import org.apache.tuscany.sca.policy.Qualifier; import org.apache.tuscany.sca.runtime.EndpointReferenceBinder; import org.apache.tuscany.sca.runtime.EndpointRegistry; @@ -466,12 +468,31 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { } else { */ - for (PolicySet policySet : referencePolicySets){ + // TODO - this code also appears in the ComponentPolicyBuilder + // so should rationalize + loop: for (PolicySet policySet : referencePolicySets){ if (policySet.getProvidedIntents().contains(intent)){ eprIntents.remove(intent); break; } + + for (Intent psProvidedIntent : policySet.getProvidedIntents()){ + if (isQualifiedBy(psProvidedIntent, intent)){ + eprIntents.remove(intent); + break loop; + } + } + + for (IntentMap map : policySet.getIntentMaps()) { + for (Qualifier q : map.getQualifiers()) { + if (intent.equals(q.getIntent())) { + eprIntents.remove(intent); + break loop; + } + } + } } + /* } */ @@ -571,6 +592,14 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { return match; } + protected boolean isQualifiedBy(Intent qualifiableIntent, Intent qualifiedIntent){ + if (qualifiedIntent.getQualifiableIntent() == qualifiableIntent){ + return true; + } else { + return false; + } + } + /** * Determine if endpoint reference and endpoint interface contracts match */ |