diff options
author | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-16 18:54:14 +0000 |
---|---|---|
committer | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-16 18:54:14 +0000 |
commit | da78c51ad2bbe51910d5626c74830daa9194b3b9 (patch) | |
tree | 269e3456ada2fc57defddacfe87e6d0b1517441e /sca-java-2.x/trunk/modules/builder/src | |
parent | ddf26a6a22a1ad546a09bcf2467b3d36a91f31e5 (diff) |
Use default intent qualification on implementations
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@964906 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/builder/src')
-rw-r--r-- | sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java | 60 |
1 files changed, 34 insertions, 26 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 1989ce02ba..d8c5db6524 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 @@ -192,9 +192,10 @@ public class CompositePolicyBuilderImpl extends ComponentPolicyBuilderImpl imple } if (implementation instanceof Composite) { - inherit(implementation, Intent.Type.implementation, true, component, composite); - checkIntentsResolved(implementation, context); + inherit(implementation, Intent.Type.implementation, true, component, composite); computePolicies((Composite)implementation, context); + expandDefaultIntents(implementation,context); + checkIntentsResolved(implementation,context); } else { resolveAndCheck(implementation, context); if (implementation != null) { @@ -205,6 +206,9 @@ public class CompositePolicyBuilderImpl extends ComponentPolicyBuilderImpl imple removeDirectPolicySetsIfExternalExists(implementation, context); + // Replace qualifiable intents with their default qualifier + expandDefaultIntents(implementation, context); + // check that all intents are resolved checkIntentsResolved(implementation, context); } @@ -219,30 +223,34 @@ public class CompositePolicyBuilderImpl extends ComponentPolicyBuilderImpl imple } private void checkForNoListenerIntent(Endpoint ep, BuilderContext context) { - PolicyHelper helper = new PolicyHelper(); - if (helper.getIntent(ep, NOLISTENER_INTENT) != null) { - error(context.getMonitor(), "NoListenerIntentSpecifiedOnService", this, ep.toString()); - } - - } - - private void removeDirectPolicySetsIfExternalExists(PolicySubject subject, BuilderContext context) { - boolean foundExternalPolicySet = false; - for (PolicySet ps : subject.getPolicySets()) { - if (ps.getAttachTo() != null) - foundExternalPolicySet = true; - } - - if (foundExternalPolicySet) { - List<PolicySet> copy = new ArrayList<PolicySet>(subject.getPolicySets()); - for (PolicySet ps : copy) { - if (ps.getAttachTo() == null) { - subject.getPolicySets().remove(ps); - } - } - } - - } + PolicyHelper helper = new PolicyHelper(); + if ( helper.getIntent(ep, NOLISTENER_INTENT) != null ) { + error(context.getMonitor(), + "NoListenerIntentSpecifiedOnService", + this, + ep.toString()); + } + + } + + private void removeDirectPolicySetsIfExternalExists(PolicySubject subject, + BuilderContext context) { + boolean foundExternalPolicySet = false; + for (PolicySet ps : subject.getPolicySets() ) { + if ( ps.getAttachTo() != null ) + foundExternalPolicySet = true; + } + + if ( foundExternalPolicySet ) { + List<PolicySet> copy = new ArrayList<PolicySet>(subject.getPolicySets()); + for ( PolicySet ps : copy ) { + if ( ps.getAttachTo() == null ) { + subject.getPolicySets().remove(ps); + } + } + } + + } /** * This is mainly about removing policies that don't "applyTo" the element where |