diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-12 13:13:13 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-12 13:13:13 +0000 |
commit | e7ce13186908ef2ec40932b2ea5b9c226174f877 (patch) | |
tree | 3fcbcfcf705fcc720aab12bd7e0a000e09e70c13 /sca-java-2.x/trunk/modules/binding-jms/src/main/java | |
parent | d6c656f919cc307885a8de1c4becc945849d9f12 (diff) |
More correctly handle the jms uri format of the binding. Still needs more work as there jms uri can be quite complicated and has a whole spec of its own that we should implement
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@984756 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jms/src/main/java')
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(); |