diff options
author | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-26 04:17:02 +0000 |
---|---|---|
committer | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-26 04:17:02 +0000 |
commit | d796a7db8c9eeddf42dc9f864d1f5860faff8b35 (patch) | |
tree | d99a2175349b4909e1b46656043e1bd1a5772c65 /sca-java-2.x/trunk/modules/assembly-xml/src/main | |
parent | 12ed7f1d0e2458a90ee4e6486c7f078562883c64 (diff) |
TUSCANY-3630 Add externalAttachment processor
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@979148 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly-xml/src/main')
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java | 23 |
1 files changed, 15 insertions, 8 deletions
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 006b80ee31..0213713ced 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 @@ -46,6 +46,7 @@ import org.apache.tuscany.sca.definitions.Definitions; import org.apache.tuscany.sca.definitions.DefinitionsFactory; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.policy.BindingType; +import org.apache.tuscany.sca.policy.ExternalAttachment; import org.apache.tuscany.sca.policy.ImplementationType; import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.IntentMap; @@ -118,6 +119,8 @@ public class DefinitionsProcessor extends BaseStAXArtifactProcessor implements S definitions.getBindingTypes().add((BindingType)extension); } else if (extension instanceof ImplementationType) { definitions.getImplementationTypes().add((ImplementationType)extension); + } else if (extension instanceof ExternalAttachment) { + definitions.getExternalAttachments().add((ExternalAttachment)extension); } } break; @@ -250,14 +253,17 @@ public class DefinitionsProcessor extends BaseStAXArtifactProcessor implements S // Flat intentMap structure by creating a policySet for each one List<PolicySet> copy = new ArrayList<PolicySet>(scaDefns.getPolicySets()); for (PolicySet policySet : copy) { - //[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; + // Add PolicySets to model based on qualified intents. The policy builder will be responsible for assigning + // the correct policy set. + // For example, ManagedTransactionPolicySet will result in: + // ManagedTransactionPolicySet (original PolicySet, must exist for matching at build time) + // ManagedTransactionPolicySet.managedTransaction.global + // ManagedTransactionPolicySet.managedTransaction.local //process intent maps for(IntentMap intentMap : policySet.getIntentMaps()) { for(Qualifier qualifier : intentMap.getQualifiers()) { - remove = true; + // remove = true; PolicySet qualifiedPolicySet = policyFactory.createPolicySet(); qualifiedPolicySet.setAppliesTo(policySet.getAppliesTo()); @@ -265,7 +271,8 @@ public class DefinitionsProcessor extends BaseStAXArtifactProcessor implements S qualifiedPolicySet.setAttachTo(policySet.getAttachTo()); qualifiedPolicySet.setAttachToXPathExpression(policySet.getAttachToXPathExpression()); - qualifiedPolicySet.setName(qualifier.getIntent().getName()); + String qualifiedLocalName = policySet.getName().getLocalPart() + "." + qualifier.getIntent().getName().getLocalPart(); + qualifiedPolicySet.setName(new QName(policySet.getName().getNamespaceURI(), qualifiedLocalName)); qualifiedPolicySet.getProvidedIntents().clear(); qualifiedPolicySet.getProvidedIntents().add(qualifier.getIntent()); qualifiedPolicySet.getPolicies().clear(); @@ -275,9 +282,9 @@ public class DefinitionsProcessor extends BaseStAXArtifactProcessor implements S } } - if(remove) { - scaDefns.getPolicySets().remove(policySet); - } +// if(remove) { +// scaDefns.getPolicySets().remove(policySet); +// } } } |