From 43fb2caf65c85ef2b671ab70f125ea8a8a876295 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 12 Aug 2010 18:01:21 +0000 Subject: Updates to get jms message selectors working properly git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@984878 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tuscany/sca/binding/jms/JMSBindingProcessor.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sca-java-2.x/trunk/modules/binding-jms/src/main/java/org') 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 30f842bced..cf2a468fce 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 @@ -373,6 +373,15 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St jmsBinding.setJMSPriority(Integer.parseInt(s.substring(9))); } else if (s.startsWith("timeToLive=")) { jmsBinding.setJMSTimeToLive(Long.parseLong(s.substring(11))); + } else if (s.startsWith("selector='")) { + String selector = s.substring(10); + if (selector.startsWith("\"") || selector.startsWith("'")) { + selector = selector.substring(1, selector.length()); + } + if (selector.endsWith("\"") || selector.endsWith("'")) { + selector = selector.substring(0, selector.length() - 1); + } + jmsBinding.setJMSSelector(selector); } else { error(monitor, "UnknownTokenInURI", jmsBinding, s, uri); return; @@ -786,7 +795,7 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St private void parseSubscriptionHeaders(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException { String jmsSelector = reader.getAttributeValue(null, "selector"); - if (jmsSelector != null && jmsSelector.length() > 0) { + if (jmsSelector != null && jmsSelector.length() > 0 && jmsBinding.getJMSSelector() == null) { jmsBinding.setJMSSelector(jmsSelector); } -- cgit v1.2.3