diff options
author | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-28 21:33:33 +0000 |
---|---|---|
committer | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-28 21:33:33 +0000 |
commit | 61b78c40dacd950091061712f8e9d3d98a1afd64 (patch) | |
tree | 33900c7286c2f586af5e084b28c69c480a61c241 /sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany | |
parent | fd81479b8cee7c161438f66a74d7863b88736e6e (diff) |
Fix handling of component type policy sets and intents
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@980237 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany')
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java index 8a01fe856c..eecb07e6cd 100644 --- a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java +++ b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java @@ -1098,17 +1098,20 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt //now resolve the implementation so that even if there is a shared instance //for this that is resolved, the specified intents and policysets are safe in the //component and not lost - List<Intent> intents = implementation.getRequiredIntents(); - List<PolicySet> policySets = implementation.getPolicySets(); - - + + List<PolicySet> policySets = new ArrayList<PolicySet>(implementation.getPolicySets()); + List<Intent> intents = new ArrayList<Intent>(implementation.getRequiredIntents()); implementation = resolveImplementation(implementation, resolver, context); - implementation.getPolicySets().clear(); - implementation.getPolicySets().addAll(policySets); - implementation.getRequiredIntents().clear(); - implementation.getRequiredIntents().addAll(intents); - + // If there are any policy sets on the implementation or component we have to + // ignore policy sets from the component type (policy spec 4.9) + if ( !policySets.isEmpty() || !component.getPolicySets().isEmpty() ) { + implementation.getPolicySets().clear(); + implementation.getPolicySets().addAll(policySets); + } + + implementation.getRequiredIntents().addAll(intents); + component.setImplementation(implementation); } |