summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-jms
diff options
context:
space:
mode:
authorbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-09-08 16:35:01 +0000
committerbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-09-08 16:35:01 +0000
commita4056aa210a2474b88ca9fc064182bea0b00bbe0 (patch)
treeec7072fdf5d895bcc23d706ec3d62af3f1751939 /sca-java-2.x/trunk/modules/binding-jms
parent67c6737195b9e096f426aa0acb203d142dae2c37 (diff)
BJM_3034 Fix validation check. The previous fix causes some other tests to fail since the destination name field will be set from the URI
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@995123 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jms')
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java9
-rw-r--r--sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java3
2 files changed, 11 insertions, 1 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 fcd022dfea..bac262ce60 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
@@ -161,6 +161,7 @@ public class JMSBinding implements Binding, PolicySubject, OperationsConfigurato
private final Integer defaultPriority = Integer.valueOf(4);
private final Boolean defaultDeliveryMode = true;
private final Long defaultJMSTimeToLive =Long.valueOf(0);
+ private boolean isDestinationSpecified = false;
public JMSBinding() {
super();
@@ -1068,5 +1069,13 @@ public class JMSBinding implements Binding, PolicySubject, OperationsConfigurato
public Integer getDefaultJMSPriority() {
return this.defaultPriority;
}
+
+ public void setIsDestinationSpecified(boolean b) {
+ this.isDestinationSpecified = b;
+ }
+
+ public boolean isDestinationSpecified() {
+ return this.isDestinationSpecified ;
+ }
}
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 9d98d33216..51bf974bd9 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
@@ -425,6 +425,7 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St
}
private void parseDestination(XMLStreamReader reader, JMSBinding jmsBinding, Monitor monitor) throws XMLStreamException {
+ jmsBinding.setIsDestinationSpecified(true);
String name = getURIString(reader, "jndiName");
if (name != null && name.length() > 0) {
jmsBinding.setDestinationName(name);
@@ -993,7 +994,7 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St
// If URI is specified, destination should not be present
if ( ( jmsBinding.getJMSURI() != null ) && ( jmsBinding.getJMSURI().length() > 0) &&
- (jmsBinding.getDestinationName() != null) && (jmsBinding.getDestinationName().length() > 0)) {
+ (jmsBinding.isDestinationSpecified())) {
error(monitor, "DestinationURIContradiction", jmsBinding, jmsBinding.getJMSURI(), jmsBinding.getDestinationName());
}