diff options
3 files changed, 13 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java index cb957cc35c..4539ad2ac7 100644 --- a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java +++ b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java @@ -659,6 +659,10 @@ public class JMSBinding implements Binding, PolicySubject, OperationsConfigurato public void setNativeOperationName(String opName, String nativeOpName) { this.nativeOperationNames .put(opName, nativeOpName); } + + public Map<String, String> getNativeOperationNames() { + return nativeOperationNames; + } public String getOperationJMSType(String opName) { if (operationPropertiesBinding != null && operationPropertiesBinding.getOperationJMSType(opName) != null) { diff --git a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java index c86f9a7f18..5cbfbefdb1 100644 --- a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java +++ b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java @@ -23,6 +23,7 @@ import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -1039,6 +1040,13 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St } } + // [BJM30029] The value of the operationProperties/@selectedOperation attribute MUST be unique across the containing binding.jms element + Set<String> ops = new HashSet<String>(jmsBinding.getNativeOperationNames().values()); + if (ops.size() != jmsBinding.getNativeOperationNames().values().size()) { + error(monitor, "BJM30029", jmsBinding); + } + + // Other jmsBinding model validation may be added here. } diff --git a/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties b/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties index 527a7471c1..6fe55f1c0f 100644 --- a/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties +++ b/sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties @@ -58,3 +58,4 @@ MissingNameForCREATE_IF_NOT_EXIST = Must specify jndiName attribute when create InvalidCreate = Attribute create {0} invalid, must be 'always', 'never', or 'ifNotExist' ActivationSpecAndDestinationMismatch = Activation spec name {0} must match destination name {1} ActivationSpecNameRequiredForCreateAlways = A JNDI name must be specified when an ActivationSpec has a create mode of "always" +BJM30029 = the selectedOperation attribute MUST be unique across the containing binding.jms element |