diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-10 12:29:51 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-08-10 12:29:51 +0000 |
commit | d5e64539010bf1fcc2351a2dc87ee8f7797a1cc1 (patch) | |
tree | c9d83c54072826011a222525384fac925aafa09d /java/sca/modules/definitions-xml | |
parent | 650715987b8fb89e2bfc6ca27790cc9beba5eabd (diff) |
TUSCANY-3020 - when definitions are aggregated together check that there are no duplicates. DOne here rather than later at the resolve phase as there is a better chance of reporting some sensible context to the user about which definitions.xml file is in error.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@802762 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/definitions-xml')
-rw-r--r-- | java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java b/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java index 7d87a8a659..699920dd6f 100644 --- a/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java +++ b/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java @@ -145,7 +145,7 @@ public class DefinitionsDocumentProcessor implements URLArtifactProcessor<Defini // QName name = reader.getName(); Object model = extensionProcessor.read(reader); if (model instanceof Definitions) { - DefinitionsUtil.aggregate((Definitions)model, definitions); + DefinitionsUtil.aggregate((Definitions)model, definitions, monitor); return definitions; } else { error("ContributionReadException", model, null); @@ -175,27 +175,7 @@ public class DefinitionsDocumentProcessor implements URLArtifactProcessor<Defini } } - // FIXME: [rfeng] We need to validate the definitions against the Conformance Items - // defined by the SCA Policy Framework Spec V1.1 - private static void stripDuplicates(Definitions definitions) { - Set<Intent> intents = new HashSet<Intent>(definitions.getIntents()); - Set<PolicySet> policySets = new HashSet<PolicySet>(definitions.getPolicySets()); - - Set<BindingType> bindingTypes = new HashSet<BindingType>(definitions.getBindingTypes()); - Set<ImplementationType> implementationTypes = new HashSet<ImplementationType>(definitions.getImplementationTypes()); - - definitions.getIntents().clear(); - definitions.getIntents().addAll(intents); - definitions.getPolicySets().clear(); - definitions.getPolicySets().addAll(policySets); - definitions.getBindingTypes().clear(); - definitions.getBindingTypes().addAll(bindingTypes); - definitions.getImplementationTypes().clear(); - definitions.getImplementationTypes().addAll(implementationTypes); - } - public void resolve(Definitions scaDefinitions, ModelResolver resolver) throws ContributionResolveException { - stripDuplicates(scaDefinitions); extensionProcessor.resolve(scaDefinitions, resolver); } |