tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r984878 - /tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
Date Thu, 12 Aug 2010 18:01:22 GMT
Author: antelder
Date: Thu Aug 12 18:01:21 2010
New Revision: 984878

URL: http://svn.apache.org/viewvc?rev=984878&view=rev
Log:
Updates to get jms message selectors working properly

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java?rev=984878&r1=984877&r2=984878&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
Thu Aug 12 18:01:21 2010
@@ -373,6 +373,15 @@ public class JMSBindingProcessor extends
                         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
 
     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);
         }
         



Mime
View raw message