Hi,
I've been taking a look at POL_4001 and have a few questions. The
intention of the test is to verify that directly attached policy sets
are ignored when externally attached policy sets are present. As far
as I can tell, the Tuscany runtime doesn't attempt to handle this at
the moment. It seems that the easiest way to handle this would be to
remove any directly attached policy sets from a PolicySubject during
the build phase if there is also an externally attached PolicySet.
This seems to achieve the goal, but there are a host of connected
issues.
For this particular test, removing the directly attached policy set
results in an intent that is not satisfied by any policy set. It
expects an exception to be thrown in this case, but we are only
producing a warning ( this happens at the end of
ComponentPolicyBuilderImpl.checkIntentsResolved() .) We only check the
reference side during wire matching, so an unsatisfied intent on a
service is never flagged as an error.
Changing this code to raise an error fixes the problem for this test,
but results in problems in other tests that use spec-defined intents
like propagatesTransaction and SOAP. The comments in the code mention
that we need to walk through the extension models here, but I'm not
sure exactly what needs to happen here. Do we really need to look at
all extensions, or are we only concerned with the specific binding or
implementation type associated with the subject?
One other related issue is that the tests that specify the
spec-defined intents seem to be assuming external attachment. For
example, POL_9015 has:
<service name="Service1" requires="propagatesTransaction">
However, the policy sets we define in policy-transaction only support
direct attachment since there is no attachTo attribute. Adding
something like: attachTo="IntentRefs('sca:propagatesTransaction')"
resolves the above issue with the propagatesTransaction intent not
being resolved, as the policy set would be applied and the intent
would be resolved when we check it at build time. The spec doesn't
seem to say anything about whether policy sets that satisfy
spec-required intents should be capable of being externally attached
or not. Should we be providing both? That seems like it would be the
only way to allow spec-defined intents to be used in conjunction with
other intents. For example, with 'requires="propagatesTransaction
myIntent"', if we require the ManagedTransactonPolicySet to be
directly attached, the policy set that satisfies myIntent would also
have to be directly attached, or propagatesTransaction would be
ignored. If we required it to be externally attached, the policy set
for myIntent would also need to be externally attached or it would be
ignored.
To summarize, what I'd like to know is:
1) Should we be raising an error at build time when intents aren't
satisfied by some policy set?
2) If yes, how do we make sure extensions are considered?
3) If no, should we be checking for this later (when we wire the endpoints?)
4) Should we be providing additional policy sets for intents required
by the spec that allow for external attachment?
Brent