diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache')
2 files changed, 22 insertions, 7 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 7480d8fe17..39ffbfb854 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 @@ -150,6 +150,7 @@ public class JMSBinding implements Binding, PolicySubject, OperationsConfigurato private WireFormat responseWireFormat; private OperationSelector operationSelector; private ExtensionType extensionType; + private String jmsURI; public JMSBinding() { super(); @@ -971,4 +972,11 @@ public class JMSBinding implements Binding, PolicySubject, OperationsConfigurato public void setExtensionType(ExtensionType intentAttachPointType) { this.extensionType = intentAttachPointType; } + + public String getJMSURI() { + return jmsURI; + } + public void setJMSURI(String jmsURI) { + this.jmsURI = jmsURI; + } } 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 5369b81d3f..a90dd67e92 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 @@ -356,9 +356,9 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St } protected void parseURI(String uri, JMSBinding jmsBinding, Monitor monitor) { - if (!uri.startsWith("jms:")) { - error(monitor, "MustStartWithSchema", jmsBinding, uri); - return; + if (!(uri.startsWith("jms:jndi:") || uri.startsWith("jms:queue:") || uri.startsWith("jms:topic:"))) { + error(monitor, "MustStartWithSchema", jmsBinding, uri); + return; } int i = uri.indexOf('?'); if (i >= 0) { @@ -378,10 +378,15 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St return; } } - jmsBinding.setDestinationName(uri.substring(4, i)); + int j=uri.indexOf(':', 4); + jmsBinding.setDestinationName(uri.substring(j+1, i)); + jmsBinding.setDestinationType(uri.substring(4, j)); } else { - jmsBinding.setDestinationName(uri.substring(4)); + int j=uri.indexOf(':', 4); + jmsBinding.setDestinationName(uri.substring(j+1)); + jmsBinding.setDestinationType(uri.substring(4, j)); } + jmsBinding.setJMSURI(uri); } public void resolve(JMSBinding model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { @@ -922,8 +927,10 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St writer.writeAttribute("name", jmsBinding.getName()); } - if (jmsBinding.getURI() != null) { - writer.writeAttribute("uri", jmsBinding.getURI()); + if (jmsBinding.getJMSURI() != null) { + writer.writeAttribute("uri", jmsBinding.getJMSURI()); + writeEnd(writer); + return; } //String dest = jmsBinding.getDestinationName(); |