diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-08 12:21:20 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-08 12:21:20 +0000 |
commit | 3571fa366df88a6bfba3e4ec972f5ec6e7bdd1da (patch) | |
tree | 1546b927f11e68b7f2858fc2abd6b21832d61e06 /sca-java-2.x/trunk/modules/core/src/main | |
parent | 4e89e387d15e50c28855127bcbbd18fb9629c78d (diff) |
TUSCANY-3529 - update binding matching to turn on code that looks at binding type provided intents
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@931904 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core/src/main')
-rw-r--r-- | sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java | 33 |
1 files changed, 21 insertions, 12 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 8eade75a8c..0a88429848 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 @@ -40,15 +40,19 @@ import org.apache.tuscany.sca.assembly.builder.PolicyBuilder; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl; +import org.apache.tuscany.sca.definitions.Definitions; 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.BindingType; 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; +import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.oasisopen.sca.ServiceRuntimeException; /** @@ -482,18 +486,26 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { List<Intent> eprIntents = new ArrayList<Intent>(); eprIntents.addAll(endpointReference.getRequiredIntents()); + // TODO - seems that we should do this loop on a binding by binding basis + // rather than each time we do matching + BindingType bindingType = null; + Definitions systemDefinitions = ((RuntimeEndpoint)endpoint).getCompositeContext().getSystemDefinitions(); + for (BindingType loopBindingType : systemDefinitions.getBindingTypes()){ + if (loopBindingType.getType().equals(binding.getType())){ + bindingType = loopBindingType; + break; + } + } + // first check the binding type - for (Intent intent : endpointReference.getRequiredIntents()){ -/* TODO - BindingType bindingType = null; //TODO - where to get this? - - if (bindingType.getAlwaysProvidedIntents().contains(intent)){ + for (Intent intent : endpointReference.getRequiredIntents()){ + if (bindingType != null && + bindingType.getAlwaysProvidedIntents().contains(intent)){ eprIntents.remove(intent); - } else if (bindingType.getMayProvidedIntents().contains(intent)){ + } else if (bindingType != null && + bindingType.getMayProvidedIntents().contains(intent)){ eprIntents.remove(intent); } else { - -*/ // TODO - this code also appears in the ComponentPolicyBuilder // so should rationalize loop: for (PolicySet policySet : referencePolicySets){ @@ -517,11 +529,8 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { } } } - } - -/* + } } - */ } // if there are unresolved intents the service and reference don't match |