PolicyConfigurationException raised incorrectly when using operation level
policy
---------------------------------------------------------------------------------
Key: TUSCANY-3256
URL: https://issues.apache.org/jira/browse/TUSCANY-3256
Project: Tuscany
Issue Type: Bug
Components: Java SCA Policy
Reporter: Greg Dritschler
Priority: Minor
A PolicyConfigurationException may be raised incorrectly when using operation
policy as shown in the example below.
<composite ...>
<component ... requires='A'>
<implementation.java class="test.MyServiceImpl"/>
<service name="MyService">
<operation name="setXYZZY" requires="B"/>
</service>
</component>
</composite>
Let's say intent 'A' constrains an implementation rather than a binding.
Constraints aren't examined until the final step of propagating the intents
into the binding. So 'A' gets inherited by the service and then the service
operation. Now the code in PolicyComputationUtil.addInheritedOpConfOnBindings
gets control to inherit the service operation intents to the binding. If it
can find a matching operation element under the binding, it goes through logic
that applies the constraint (among among things). This would keep 'A' from
being inherited by the binding level. However if it can't find an operation
element under the binding, it simply adds a new operation element without doing
any checking on it. This leads to a PolicyConfigurationException because there
is no policy that applies to the binding and satisfies 'A'.
I am attaching a patch that changes the logic in
PolicyComputationUtil.addInheritedOpConfOnBindings so that added binding
operations go through the same logic as existing operations.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.