diff options
author | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-05 03:01:09 +0000 |
---|---|---|
committer | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-05 03:01:09 +0000 |
commit | c2281244d53f2af5209c892e6eda3f1b48af0cbf (patch) | |
tree | 4790332f7ed8b45c0df18f3da1a006806a8a31d2 /sca-java-2.x/trunk/modules/builder/src/main/java | |
parent | 66fe1748dc4497df03c618a91be8ac0e07c7e715 (diff) |
TUSCANY-3642 Allow policy information on interfaces to apply to services and bindings, even if it is mutually exclusive with policy information on those elements.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@982458 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/builder/src/main/java')
-rw-r--r-- | sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java index 2a88a48c8c..9c4da518d7 100644 --- a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java +++ b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java @@ -105,10 +105,7 @@ public class CompositePolicyBuilderImpl extends ComponentPolicyBuilderImpl imple } for (Endpoint ep : componentService.getEndpoints()) { - if (componentService.getInterfaceContract() != null) { - // Inherit from the component.service.interface - inherit(ep, null, true, componentService.getInterfaceContract().getInterface()); - } + // Inherit from binding inherit(ep, null, true, ep.getBinding()); @@ -116,7 +113,12 @@ public class CompositePolicyBuilderImpl extends ComponentPolicyBuilderImpl imple // Inherit from composite/component/service inherit(ep, null, true, ep.getService(), ep.getComponent(), composite ); - + if (componentService.getInterfaceContract() != null) { + // Inherit from the component.service.interface + // Do not check mutual exclusion here.. interfaces do not follow normal rules + // of the structural hierarchy (Policy spec 4.10) + inherit(ep, null, false, componentService.getInterfaceContract().getInterface()); + } // Replace profile intents with their required intents // Replace unqualified intents if there is a qualified intent in the list @@ -159,19 +161,19 @@ public class CompositePolicyBuilderImpl extends ComponentPolicyBuilderImpl imple } for (EndpointReference epr : componentReference.getEndpointReferences()) { - - // Inherit from the component.reference.interface - if (componentReference.getInterfaceContract() != null) { - inherit(epr, null, true, componentReference.getInterfaceContract().getInterface()); - } - + // Inherit from binding inherit(epr, null, true, epr.getBinding()); // Inherit from composite/component/reference inherit(epr, null, true, epr.getReference(), epr.getComponent(), composite); - + // Inherit from the component.reference.interface + if (componentReference.getInterfaceContract() != null) { + // Do not check mutual exclusion here.. interfaces do not follow normal rules + // of the structural hierarchy (Policy spec 4.10) + inherit(epr, null, true, componentReference.getInterfaceContract().getInterface()); + } // Replace profile intents with their required intents // Replace unqualified intents if there is a qualified intent in the list |