summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-08-27 18:01:00 +0000
committerbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-08-27 18:01:00 +0000
commitb8d03880cc4c031f0c5b89bab6af92c9e261516f (patch)
treea7fd0b735c764c80b13685d5c958b4bf482609ed /sca-java-2.x/trunk
parent6739a259b245dfd7953efe3ff2b6a55570be55e5 (diff)
BJM_3019 Add validation to make sure the jms binding destination name matches the activation spec name
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@990217 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java8
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties1
2 files changed, 9 insertions, 0 deletions
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 8ddcd6a099..dfb3dd9412 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
@@ -987,6 +987,14 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St
error(monitor, "ConnectionFactoryActivationSpecContradiction", jmsBinding, connectionFactoryName, activationSpecName );
}
}
+
+ // If activation spec and destination are both specified, they have to match
+ if ( ( jmsBinding.getActivationSpecName() != null ) && (jmsBinding.getActivationSpecName().length() > 0 ) &&
+ (jmsBinding.getDestinationName() != null) && (jmsBinding.getDestinationName().length() > 0 ) ) {
+ if ( !jmsBinding.getActivationSpecName().equals(jmsBinding.getDestinationName())) {
+ error(monitor, "ActivationSpecAndDestinationMismatch", jmsBinding, jmsBinding.getActivationSpecName(), jmsBinding.getDestinationName());
+ }
+ }
// If Connection factory specified then destination name must also be
if (( connectionFactoryName != null ) && ( connectionFactoryName.length() > 0 )) {
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 147290b862..91b24bb1a2 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
@@ -55,3 +55,4 @@ ResponseWireformatAlreadyDefined = The response wireformat has already been defi
MissingNameForCREATE_NEVER = Must specify jndiName attribute when create mode is "never"
MissingNameForCREATE_IF_NOT_EXIST = Must specify jndiName attribute when create mode is "ifNotExist"
InvalidCreate = Attribute create {0} invalid, must be 'always', 'never', or 'ifNotExist'
+ActivationSpecAndDestinationMismatch = Activation spec name {0} must match destination name {1}