diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-24 00:58:29 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-24 00:58:29 +0000 |
commit | 91e330ac2836a87d28688489f2714fdd3c462721 (patch) | |
tree | 5b97170da93f765bc4404e2085c198cc9ca02e5a /java/sca | |
parent | 1d8bf33098550d4336cec0d1426496e63dd8f0ee (diff) |
Minor clean up
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@747242 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r-- | java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java | 52 |
1 files changed, 17 insertions, 35 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 2f9c5d3379..1bfa89acc3 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 @@ -99,26 +99,6 @@ public class DefinitionsDocumentProcessor implements URLArtifactProcessor<Defini } /** - * Report a error. - * - * @param problems - * @param message - * @param model - */ - private void error(String message, Object model, Object... messageParameters) { - if (monitor != null) { - Problem problem = - monitor.createProblem(this.getClass().getName(), - "definitions-xml-validation-messages", - Severity.ERROR, - model, - message, - (Object[])messageParameters); - monitor.problem(problem); - } - } - - /** * Report a exception. * * @param problems @@ -200,21 +180,23 @@ public class DefinitionsDocumentProcessor implements URLArtifactProcessor<Defini } } - private static void stripDuplicates(Definitions scaDefns) { - Set<Intent> definedIntents = new HashSet<Intent>(scaDefns.getIntents()); - Set<PolicySet> definedPolicySets = new HashSet<PolicySet>(scaDefns.getPolicySets()); - - Set<BindingType> definedBindingTypes = new HashSet<BindingType>(scaDefns.getBindingTypes()); - Set<ImplementationType> definedImplTypes = new HashSet<ImplementationType>(scaDefns.getImplementationTypes()); - - scaDefns.getIntents().clear(); - scaDefns.getIntents().addAll(definedIntents); - scaDefns.getPolicySets().clear(); - scaDefns.getPolicySets().addAll(definedPolicySets); - scaDefns.getBindingTypes().clear(); - scaDefns.getBindingTypes().addAll(definedBindingTypes); - scaDefns.getImplementationTypes().clear(); - scaDefns.getImplementationTypes().addAll(definedImplTypes); + // 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 { |