diff options
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()); } |