summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 15:16:06 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 15:16:06 +0000
commit88ec92eec750fd830ab4149391b7f07f0df9d69d (patch)
tree4b02d3124140d701e031e00a09aba9efc5ab2357 /java/sca
parentfca0c8958c7efa3c91a0a31c0dfc3a684013f749 (diff)
POL_3004 check that only one default qualifier is specified for an intent
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834901 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java10
-rw-r--r--java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties1
2 files changed, 10 insertions, 1 deletions
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java
index ac4f81d5a9..49960cf6e8 100644
--- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java
+++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java
@@ -149,7 +149,15 @@ public class IntentProcessor extends BaseStAXArtifactProcessor implements StAXAr
qualified.setType(intent.getType());
qualified.setName(new QName(qualifiedIntentName));
if (isDefault) {
- intent.setDefaultQualifiedIntent(qualified);
+ if (intent.getDefaultQualifiedIntent() == null){
+ intent.setDefaultQualifiedIntent(qualified);
+ } else {
+ Monitor.error(context.getMonitor(),
+ this,
+ Messages.RESOURCE_BUNDLE,
+ "MultipleDefaultQualifiers",
+ intent.getName().toString());
+ }
}
intent.getQualifiedIntents().add(qualified);
qualified.setQualifiableIntent(intent);
diff --git a/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties
index d092b5959a..6fb369f73f 100644
--- a/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties
+++ b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties
@@ -42,4 +42,5 @@ PolicySetAppliesToMissing = Required attribute "appliesTo" missing for PolicySet
IntentMapProvidesMissing = Required attribute "provides" missing for IntentMap in PolicySet : {0}
QualifierNameMissing = Required attribute "name" missing for qualifier definition in PolicySet : {0}
ConstrainedTypeNotFound = Unable to find the extension type {0} constrained by intent: {1}
+MultipleDefaultQualifiers = [POL30004] Intent {0} has more than one qualifier marked as the default qualifier