summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-08-12 14:27:37 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-08-12 14:27:37 +0000
commit3b7e36b189369faa5c1a304d6a3882420366616a (patch)
tree892d7f3761f2a6466cc5f7e3d622d441b5a60c72 /sca-java-2.x
parent7e546d4295fbeb4b9fce6065715c8cee71623de9 (diff)
Check that a destination is defined when connectionFactory element is used
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@984801 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x')
-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 a90dd67e92..30f842bced 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
@@ -883,6 +883,14 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St
}
}
+ // If Connection factory specified then destination name must also be
+ if (( connectionFactoryName != null ) && ( connectionFactoryName.length() > 0 )) {
+ String destinationName = jmsBinding.getDestinationName();
+ if ((destinationName == null) || (destinationName.length() < 1 )) {
+ error(monitor, "ConnectionFactoryDestinationContradiction", jmsBinding, connectionFactoryName);
+ }
+ }
+
// Given a response connection name attribute, there must not be a response element.
// 156 /binding.jms/@responseConnection - identifies a binding.jms element that is present in a
// 157 definition document, whose response child element is used to define the values for this binding. In
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 ca924c3c8f..94f4c70cb1 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
@@ -45,6 +45,7 @@ InvalidOPJMSPriority = Invalid OPJMSPriority: {0}
DestinationQueueContradiction = Destination type queue contradicts connection factory name: {0}
DestinationTopicContradiction = Destination type topic contradicts connection factory name: {0}
ConnectionFactoryActivationSpecContradiction = Connection factory \"{0}\" and activation specification \"{0}\" are mutually exclusive
+ConnectionFactoryDestinationContradiction = When connection factory \"{0}\" element is present then a destination name must also be defined
ResponseAttrElement = Response connection \"{0}\" and response element \"{1}\" are mutually exclusive
BindingNotFound = {0} refers to a binding definition {1} which is not found
DuplicateOperationProperties = Must not use both operationProperties attribute and operationProperties element