// 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;
}
}
// Before we start examining intents, remove any whose constrained
// types don't include the binding type
removeConstrainedIntents(endpointReference, bindingType);
List<Intent> eprIntents = new ArrayList<Intent>();
eprIntents.addAll(endpointReference.getRequiredIntents());
// first check the binding type
for (Intent intent : endpointReference.getRequiredIntents()){
if (bindingType != null &&
bindingType.getAlwaysProvidedIntents().contains(intent)){
eprIntents.remove(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){