From 736d9f948449d956568d122224278acd1af9b19e Mon Sep 17 00:00:00 2001 From: lresende Date: Fri, 26 Feb 2010 21:25:33 +0000 Subject: TUSCANY-3463 - Removing the policySet that is being flatted to avoid issues during resolution git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@916821 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/definitions/xml/DefinitionsProcessor.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java') diff --git a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java index 745e94354a..629c9e255f 100644 --- a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java +++ b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java @@ -250,12 +250,15 @@ public class DefinitionsProcessor extends BaseStAXArtifactProcessor implements S // Flat intentMap structure by creating a policySet for each one List copy = new ArrayList(scaDefns.getPolicySets()); for (PolicySet policySet : copy) { - //[LRESENDE] Do we need to remove the current policySet and just include the flat one based on qualifiers ? - //Maybe not, as this would resolve to explicitly attached policySet + //[lresende] Do we need to remove the current policySet and just include the flat one based on qualifiers ? + //If we don't, the policy is being resolved to the one that has intentMap and no direct concrete policies + boolean remove = false; //process intent maps for(IntentMap intentMap : policySet.getIntentMaps()) { for(Qualifier qualifier : intentMap.getQualifiers()) { + remove = true; + PolicySet qualifiedPolicySet = policyFactory.createPolicySet(); qualifiedPolicySet.setAppliesTo(policySet.getAppliesTo()); qualifiedPolicySet.setAppliesToXPathExpression(policySet.getAttachToXPathExpression()); @@ -271,6 +274,10 @@ public class DefinitionsProcessor extends BaseStAXArtifactProcessor implements S scaDefns.getPolicySets().add(qualifiedPolicySet); } } + + if(remove) { + scaDefns.getPolicySets().remove(policySet); + } } } -- cgit v1.2.3