When I investigate TUSCANY-3242, I realized that the matching algorithm [2]
is NOT correct. The check against the size of the intents and policySets is
bogus.
For an SCA wire, the endpoint reference and endpoint can be configured with
interaction policies. Some of the intents are realized by policySets while
the rest are natively supported by the bindings. Depending on the policy
language, there can be different cases to apply a policy.
a. The policy can only be applied to references
b. The policy can only be applied to services
c. The policy can be applied to both references and services
c.1: The policies on both sides are coupled and have to be compatible
c.2: The policies on both sides can be enforced independently
Two players should be involved to check the compatibility of the policy
configuration on the wired endpoint reference and enpoint:
* Binding (to handle the natively supported intents)
* Policy Language Provider (to check the compatibility of the policies in
case c.2)
IMO, we should come up an ExtensionPoint that collects the Policy/Intent
mappers which can be contributed from binding and policy language
extensions. Thoughts?
I'll comment out the code in [2] so that I can use itest/policies to
validate the policy builders I'm working.
Thanks,
Raymond
[1] https://issues.apache.org/jira/browse/TUSCANY-3242
[2]
org.apache.tuscany.sca.endpoint.impl.EndpointReferenceBuilderImpl.haveMatchingPolicy(EndpointReference,
Endpoint)
---
Raymond Feng
Apache Tuscany PMC Member: http://tuscany.apache.org
Co-author of Tuscany In Action: http://www.manning.com/laws