You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2011/09/04 23:58:49 UTC

svn commit: r1165120 - in /qpid/branches/rg-amqp-1-0-sandbox/qpid/java: amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/ amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/ amqp-1-0-common/src/main/java/org/apache/qpid/am...

Author: rgodfrey
Date: Sun Sep  4 21:58:48 2011
New Revision: 1165120

URL: http://svn.apache.org/viewvc?rev=1165120&view=rev
Log:
NO-JIRA: JMS Fixes

Modified:
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSenderImpl.java
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicPublisherImpl.java
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Connection.java
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Sender.java
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/SessionEndpoint.java
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MessageAnnotationsWriter.java
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/client/src/main/grammar/SelectorParser.jj

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java?rev=1165120&r1=1165119&r2=1165120&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/MessageProducerImpl.java Sun Sep  4 21:58:48 2011
@@ -176,6 +176,11 @@ public class MessageProducerImpl impleme
 
     public void send(final Message message, final int deliveryMode, final int priority, final long ttl) throws JMSException
     {
+        if(_sender == null)
+        {
+            throw new UnsupportedOperationException("No Destination provided");
+        }
+
         //TODO
         MessageImpl msg;
         if(message instanceof org.apache.qpid.amqp_1_0.jms.Message)
@@ -187,6 +192,8 @@ public class MessageProducerImpl impleme
             msg = _session.convertMessage(message);
         }
 
+
+
         msg.setJMSDeliveryMode(deliveryMode);
         msg.setJMSPriority(priority);
 
@@ -312,14 +319,14 @@ public class MessageProducerImpl impleme
         }
     }
 
-    public Queue getQueue() throws JMSException
+    public QueueImpl getQueue() throws JMSException
     {
-        return (Queue) getDestination();
+        return (QueueImpl) getDestination();
     }
 
-    public Topic getTopic() throws JMSException
+    public TopicImpl getTopic() throws JMSException
     {
-        return (Topic) getDestination();
+        return (TopicImpl) getDestination();
     }
 
     public void publish(final Message message) throws JMSException

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSenderImpl.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSenderImpl.java?rev=1165120&r1=1165119&r2=1165120&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSenderImpl.java (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/QueueSenderImpl.java Sun Sep  4 21:58:48 2011
@@ -32,19 +32,5 @@ public class QueueSenderImpl extends Mes
         super(destination, session);
     }
 
-    public QueueImpl getQueue() throws JMSException
-    {
-        return null;  //TODO
-    }
-
-    public void send(final javax.jms.Queue queue, final Message message) throws JMSException
-    {
-        //TODO
-    }
 
-    public void send(final javax.jms.Queue queue, final Message message, final int i, final int i1, final long l)
-            throws JMSException
-    {
-        //TODO
-    }
 }

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicPublisherImpl.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicPublisherImpl.java?rev=1165120&r1=1165119&r2=1165120&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicPublisherImpl.java (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client-jms/src/main/java/org/apache/qpid/amqp_1_0/jms/impl/TopicPublisherImpl.java Sun Sep  4 21:58:48 2011
@@ -33,29 +33,4 @@ public class TopicPublisherImpl extends 
         super(destination, session);
     }
 
-    public TopicImpl getTopic() throws JMSException
-    {
-        return null;  //TODO
-    }
-
-    public void publish(final Message message) throws JMSException
-    {
-        //TODO
-    }
-
-    public void publish(final Message message, final int i, final int i1, final long l) throws JMSException
-    {
-        //TODO
-    }
-
-    public void publish(final Topic topic, final Message message) throws JMSException
-    {
-        //TODO
-    }
-
-    public void publish(final Topic topic, final Message message, final int i, final int i1, final long l)
-            throws JMSException
-    {
-        //TODO
-    }
 }

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Connection.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Connection.java?rev=1165120&r1=1165119&r2=1165120&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Connection.java (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Connection.java Sun Sep  4 21:58:48 2011
@@ -42,6 +42,7 @@ import java.util.logging.Logger;
 public class Connection
 {
     private static final Logger RAW_LOGGER = Logger.getLogger("RAW");
+    private static final int MAX_FRAME_SIZE = 65536;
 
     private String _address;
     private ConnectionEndpoint _conn;
@@ -53,7 +54,7 @@ public class Connection
                   final String username,
                   final String password) throws ConnectionException
     {
-        this(address, port, username, password, 65536);
+        this(address, port, username, password, MAX_FRAME_SIZE);
     }
     public Connection(final String address,
                   final int port,
@@ -68,6 +69,16 @@ public class Connection
                   final int port,
                   final String username,
                   final String password,
+                  final Container container) throws ConnectionException
+    {
+        this(address,port,username,password,MAX_FRAME_SIZE,container);
+    }
+
+
+    public Connection(final String address,
+                  final int port,
+                  final String username,
+                  final String password,
                   final int maxFrameSize,
                   final Container container) throws ConnectionException
     {

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Sender.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Sender.java?rev=1165120&r1=1165119&r2=1165120&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Sender.java (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Sender.java Sun Sep  4 21:58:48 2011
@@ -24,6 +24,9 @@ import org.apache.qpid.amqp_1_0.messagin
 import org.apache.qpid.amqp_1_0.transport.DeliveryStateHandler;
 import org.apache.qpid.amqp_1_0.transport.SendingLinkEndpoint;
 import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.Source;
+import org.apache.qpid.amqp_1_0.type.Target;
+import org.apache.qpid.amqp_1_0.type.messaging.*;
 import org.apache.qpid.amqp_1_0.type.transaction.TransactionalState;
 import org.apache.qpid.amqp_1_0.type.transport.*;
 
@@ -61,6 +64,12 @@ public class Sender implements DeliveryS
     }
 
 
+    public Sender(final Session session, final String linkName, final org.apache.qpid.amqp_1_0.type.messaging.Target target, final org.apache.qpid.amqp_1_0.type.messaging.Source source,
+                  int window) throws SenderCreationException
+    {
+        this(session, linkName, target, source, window, AcknowledgeMode.ALO);
+    }
+
     public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
                   int window, AcknowledgeMode mode)
             throws SenderCreationException
@@ -68,6 +77,13 @@ public class Sender implements DeliveryS
         this(session, linkName, targetAddr, sourceAddr, window, mode, null);
     }
 
+    public Sender(final Session session, final String linkName, final org.apache.qpid.amqp_1_0.type.messaging.Target target, final org.apache.qpid.amqp_1_0.type.messaging.Source source,
+                  int window, AcknowledgeMode mode)
+            throws SenderCreationException
+    {
+        this(session, linkName, target, source, window, mode, null);
+    }
+
     public Sender(final Session session, final String linkName, final String targetAddr, final String sourceAddr,
                   int window, AcknowledgeMode mode, Map<Binary, Outcome> unsettled)
             throws SenderCreationException
@@ -79,9 +95,36 @@ public class Sender implements DeliveryS
                   int window, AcknowledgeMode mode, boolean isDurable, Map<Binary, Outcome> unsettled)
             throws SenderCreationException
     {
+        this(session, linkName, createTarget(targetAddr, isDurable), createSource(sourceAddr), window, mode, unsettled);
+    }
+
+    private static org.apache.qpid.amqp_1_0.type.messaging.Source createSource(final String sourceAddr)
+    {
+        org.apache.qpid.amqp_1_0.type.messaging.Source source = new org.apache.qpid.amqp_1_0.type.messaging.Source();
+        source.setAddress(sourceAddr);
+        return source;
+    }
+
+    private static org.apache.qpid.amqp_1_0.type.messaging.Target createTarget(final String targetAddr, final boolean isDurable)
+    {
+        org.apache.qpid.amqp_1_0.type.messaging.Target target = new org.apache.qpid.amqp_1_0.type.messaging.Target();
+        target.setAddress(targetAddr);
+        if(isDurable)
+        {
+            target.setDurable(TerminusDurability.UNSETTLED_STATE);
+            target.setExpiryPolicy(TerminusExpiryPolicy.NEVER);
+        }
+        return target;
+    }
+
+    public Sender(final Session session, final String linkName, final org.apache.qpid.amqp_1_0.type.messaging.Target target, final org.apache.qpid.amqp_1_0.type.messaging.Source source,
+                  int window, AcknowledgeMode mode, Map<Binary, Outcome> unsettled)
+            throws SenderCreationException
+    {
 
         _session = session;
-        _endpoint = session.getEndpoint().createSendingLinkEndpoint(linkName, targetAddr, sourceAddr, isDurable, unsettled);
+        _endpoint = session.getEndpoint().createSendingLinkEndpoint(linkName,
+                                                                    source, target, unsettled);
 
 
         switch(mode)
@@ -118,11 +161,21 @@ public class Sender implements DeliveryS
             }
             if(_endpoint.getTarget()== null)
             {
-                throw new SenderCreationException("Peer did not create remote endpoint for link, target: " + targetAddr);
+                throw new SenderCreationException("Peer did not create remote endpoint for link, target: " + target.getAddress());
             };
         }
     }
 
+    public Source getSource()
+    {
+        return _endpoint.getSource();
+    }
+
+    public Target getTarget()
+    {
+        return _endpoint.getTarget();
+    }
+
     public void send(Message message)
     {
         send(message, null, null);

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java?rev=1165120&r1=1165119&r2=1165120&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java Sun Sep  4 21:58:48 2011
@@ -221,6 +221,20 @@ public class Session
         return receiver;
     }
 
+    public Sender createTemporaryQueueSender() throws Sender.SenderCreationException
+    {
+        Target target = new Target();
+        target.setDynamic(true);
+
+        final Sender sender;
+        sender = new Sender(this, "tempSender"+ UUID.randomUUID().toString(), target,
+                                                   new Source(), 0, AcknowledgeMode.ALO);
+        _senders.add(sender);
+        return sender;
+    }
+
+
+
     public SessionEndpoint getEndpoint()
     {
         return _endpoint;

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/SessionEndpoint.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/SessionEndpoint.java?rev=1165120&r1=1165119&r2=1165120&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/SessionEndpoint.java (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/SessionEndpoint.java Sun Sep  4 21:58:48 2011
@@ -474,12 +474,12 @@ public class SessionEndpoint
 
     }
 
-    private SendingLinkEndpoint createSendingLinkEndpoint(final String name, final Source source, final org.apache.qpid.amqp_1_0.type.Target target)
+    public SendingLinkEndpoint createSendingLinkEndpoint(final String name, final Source source, final org.apache.qpid.amqp_1_0.type.Target target)
     {
         return createSendingLinkEndpoint(name, source, target, null);
     }
 
-    private SendingLinkEndpoint createSendingLinkEndpoint(final String name, final Source source, final org.apache.qpid.amqp_1_0.type.Target target, Map<Binary, Outcome> unsettled)
+    public SendingLinkEndpoint createSendingLinkEndpoint(final String name, final Source source, final org.apache.qpid.amqp_1_0.type.Target target, Map<Binary, Outcome> unsettled)
     {
         SendingLinkEndpoint endpoint = new SendingLinkEndpoint(this, name, unsettled);
         endpoint.setSource(source);

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MessageAnnotationsWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MessageAnnotationsWriter.java?rev=1165120&r1=1165119&r2=1165120&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MessageAnnotationsWriter.java (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MessageAnnotationsWriter.java Sun Sep  4 21:58:48 2011
@@ -60,7 +60,7 @@ public class MessageAnnotationsWriter ex
     @Override
     protected ValueWriter createDescribedWriter()
     {
-        return getRegistry().getValueWriter(_value);
+        return getRegistry().getValueWriter(_value.getValue());
     }
 
     private static Factory<MessageAnnotations> FACTORY = new Factory<MessageAnnotations>()

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java?rev=1165120&r1=1165119&r2=1165120&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java Sun Sep  4 21:58:48 2011
@@ -1642,13 +1642,15 @@ public class SimpleAMQQueue implements A
 
         while (!sub.isSuspended() && !atTail && iterations != 0)
         {
+            boolean queueEmpty = false;
+
             try
             {
                 sub.getSendLock();
                 atTail = attemptDelivery(sub);
                 if (atTail && getNextAvailableEntry(sub) == null)
                 {
-                    sub.queueEmpty();
+                    queueEmpty = true;
                 }
                 else if (!atTail)
                 {
@@ -1659,6 +1661,10 @@ public class SimpleAMQQueue implements A
             {
                 sub.releaseSendLock();
             }
+            if(queueEmpty)
+            {
+                sub.queueEmpty();
+            }
         }
 
         // if there's (potentially) more than one subscription the others will potentially not have been advanced to the
@@ -1860,7 +1866,7 @@ public class SimpleAMQQueue implements A
                     }
                     else
                     {
-                        //this subscription can accept additional deliveries, so we must 
+                        //this subscription can accept additional deliveries, so we must
                         //keep going after this (if iteration slicing allows it)
                         allSubscriptionsDone = false;
                         lastLoop = false;

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/client/src/main/grammar/SelectorParser.jj
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/client/src/main/grammar/SelectorParser.jj?rev=1165120&r1=1165119&r2=1165120&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/client/src/main/grammar/SelectorParser.jj (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/client/src/main/grammar/SelectorParser.jj Sun Sep  4 21:58:48 2011
@@ -1,609 +1,609 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
- //
- // Original File from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
- //
-
-// ----------------------------------------------------------------------------
-// OPTIONS
-// ----------------------------------------------------------------------------
-options {
-  STATIC = false;
-  UNICODE_INPUT = true;
-
-  // some performance optimizations
-  OPTIMIZE_TOKEN_MANAGER = true;
-  ERROR_REPORTING = false;
-}
-
-// ----------------------------------------------------------------------------
-// PARSER
-// ----------------------------------------------------------------------------
-
-PARSER_BEGIN(SelectorParser)
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.filter.selector;
-
-import java.io.StringReader;
-import java.util.ArrayList;
-
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+ //
+ // Original File from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
+ //
+
+// ----------------------------------------------------------------------------
+// OPTIONS
+// ----------------------------------------------------------------------------
+options {
+  STATIC = false;
+  UNICODE_INPUT = true;
+
+  // some performance optimizations
+  OPTIMIZE_TOKEN_MANAGER = true;
+  ERROR_REPORTING = false;
+}
+
+// ----------------------------------------------------------------------------
+// PARSER
+// ----------------------------------------------------------------------------
+
+PARSER_BEGIN(SelectorParser)
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.qpid.filter.selector;
+
+import java.io.StringReader;
+import java.util.ArrayList;
+
 import org.apache.qpid.AMQInternalException;
-import org.apache.qpid.filter.ArithmeticExpression;
-import org.apache.qpid.filter.BooleanExpression;
-import org.apache.qpid.filter.ComparisonExpression;
-import org.apache.qpid.filter.ConstantExpression;
-import org.apache.qpid.filter.Expression;
-import org.apache.qpid.filter.LogicExpression;
-import org.apache.qpid.filter.PropertyExpression;
-import org.apache.qpid.filter.UnaryExpression;
-
-/**
- * JMS Selector Parser generated by JavaCC
- *
- * Do not edit this .java file directly - it is autogenerated from SelectorParser.jj
- */
-public class SelectorParser {
-
-    public SelectorParser() {
-        this(new StringReader(""));
-    }
-
-    public BooleanExpression parse(String sql) throws AMQInternalException {
-        this.ReInit(new StringReader(sql));
-
-        try {
-            return this.JmsSelector();
-        }
-        catch (Throwable e) {
-	        throw new AMQInternalException(sql,e);
-        }
-
-    }
-
-    private BooleanExpression asBooleanExpression(Expression value) throws ParseException  {
-        if (value instanceof BooleanExpression) {
-            return (BooleanExpression) value;
-        }
-        if (value instanceof PropertyExpression) {
-            return UnaryExpression.createBooleanCast( value );
-        }
-        throw new ParseException("Expression will not result in a boolean value: " + value);
-    }
-
-
-}
-
-PARSER_END(SelectorParser)
-
-// ----------------------------------------------------------------------------
-// Tokens
-// ----------------------------------------------------------------------------
-
-/* White Space */
-SPECIAL_TOKEN :
-{
-  " " | "\t" | "\n" | "\r" | "\f"
-}
-
-/* Comments */
-SKIP:
-{
-  <LINE_COMMENT: "--" (~["\n","\r"])* ("\n"|"\r"|"\r\n") >
-}
-
-SKIP:
-{
-  <BLOCK_COMMENT: "/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/">
-}
-
-/* Reserved Words */
-TOKEN [IGNORE_CASE] :
-{
-    <  NOT     : "NOT">
-  | <  AND     : "AND">
-  | <  OR      : "OR">
-  | <  BETWEEN : "BETWEEN">
-  | <  LIKE    : "LIKE">
-  | <  ESCAPE  : "ESCAPE">
-  | <  IN      : "IN">
-  | <  IS      : "IS">
-  | <  TRUE    : "TRUE" >
-  | <  FALSE   : "FALSE" >
-  | <  NULL    : "NULL" >  
-}
-
-/* Literals */
-TOKEN [IGNORE_CASE] :
-{
-
-    < DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* (["l","L"])? >
-  | < HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
-  | < OCTAL_LITERAL: "0" (["0"-"7"])* >
-  | < FLOATING_POINT_LITERAL:
-          (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? // matches: 5.5 or 5. or 5.5E10 or 5.E10
-        | "." (["0"-"9"])+ (<EXPONENT>)?              // matches: .5 or .5E10
-        | (["0"-"9"])+ <EXPONENT>                     // matches: 5E10
-    >
-  | < #EXPONENT: "E" (["+","-"])? (["0"-"9"])+ >
-  | < STRING_LITERAL: "'" ( ("''") | ~["'"] )*  "'" >
-}
-
-TOKEN [IGNORE_CASE] :
-{
-    < ID : ["a"-"z", "_", "$"] (["a"-"z","0"-"9","_", "$"])* >
-    | < QUOTED_ID : "\"" ( ("\"\"") | ~["\""] )*  "\""  >
-
-}
-
-// ----------------------------------------------------------------------------
-// Grammer
-// ----------------------------------------------------------------------------
-BooleanExpression JmsSelector() :
-{
-    Expression left=null;
-}
-{
-    (
-        left = orExpression()
-    )
-    {
-        return asBooleanExpression(left);
-    }
-
-}
-
-Expression orExpression() :
-{
-    Expression left;
-    Expression right;
-}
-{
-    (
-        left = andExpression()
-        (
-            <OR> right = andExpression()
-            {
-                left = LogicExpression.createOR(asBooleanExpression(left), asBooleanExpression(right));
-            }
-        )*
-    )
-    {
-        return left;
-    }
-
-}
-
-
-Expression andExpression() :
-{
-    Expression left;
-    Expression right;
-}
-{
-    (
-        left = equalityExpression()
-        (
-            <AND> right = equalityExpression()
-            {
-                left = LogicExpression.createAND(asBooleanExpression(left), asBooleanExpression(right));
-            }
-        )*
-    )
-    {
-        return left;
-    }
-}
-
-Expression equalityExpression() :
-{
-    Expression left;
-    Expression right;
-}
-{
-    (
-        left = comparisonExpression()
-        (
-
-            "=" right = comparisonExpression()
-            {
-                left = ComparisonExpression.createEqual(left, right);
-            }
-            |
-            "<>" right = comparisonExpression()
-            {
-                left = ComparisonExpression.createNotEqual(left, right);
-            }
-            |
-            LOOKAHEAD(2)
-            <IS> <NULL>
-            {
-                left = ComparisonExpression.createIsNull(left);
-            }
-            |
-            <IS> <NOT> <NULL>
-            {
-                left = ComparisonExpression.createIsNotNull(left);
-            }
-        )*
-    )
-    {
-        return left;
-    }
-}
-
-Expression comparisonExpression() :
-{
-    Expression left;
-    Expression right;
-    Expression low;
-    Expression high;
-    String t, u;
-	boolean not;
-	ArrayList list;
-}
-{
-    (
-        left = addExpression()
-        (
-
-                ">" right = addExpression()
-                {
-                    left = ComparisonExpression.createGreaterThan(left, right);
-                }
-            |
-                ">=" right = addExpression()
-                {
-                    left = ComparisonExpression.createGreaterThanEqual(left, right);
-                }
-            |
-                "<" right = addExpression()
-                {
-                    left = ComparisonExpression.createLessThan(left, right);
-                }
-            |
-                "<=" right = addExpression()
-                {
-                    left = ComparisonExpression.createLessThanEqual(left, right);
-                }
-           |
-				{
-					u=null;
-				}
-		        <LIKE> t = stringLitteral()
-		        	[ <ESCAPE> u = stringLitteral() ]
-		        {
-                    left = ComparisonExpression.createLike(left, t, u);
-		        }
-           |
-	        	LOOKAHEAD(2)
-				{
-					u=null;
-				}
-		        <NOT> <LIKE> t = stringLitteral() [ <ESCAPE> u = stringLitteral() ]
-		        {
-                    left = ComparisonExpression.createNotLike(left, t, u);
-		        }
-            |
-		        <BETWEEN> low = addExpression() <AND> high = addExpression()
-		        {
-					left = ComparisonExpression.createBetween(left, low, high);
-		        }
-	        |
-	        	LOOKAHEAD(2)
-		        <NOT> <BETWEEN> low = addExpression() <AND> high = addExpression()
-		        {
-					left = ComparisonExpression.createNotBetween(left, low, high);
-		        }
-            |
-				<IN>
-		        "("
-		            t = stringLitteral()
-		            {
-			            list = new ArrayList();
-			            list.add( t );
-		            }
-			        (
-			        	","
-			            t = stringLitteral()
-			            {
-				            list.add( t );
-			            }
-
-			        )*
-		        ")"
-		        {
-		           left = ComparisonExpression.createInFilter(left, list);
-		        }
-            |
-	        	LOOKAHEAD(2)
-	            <NOT> <IN>
-		        "("
-		            t = stringLitteral()
-		            {
-			            list = new ArrayList();
-			            list.add( t );
-		            }
-			        (
-			        	","
-			            t = stringLitteral()
-			            {
-				            list.add( t );
-			            }
-
-			        )*
-		        ")"
-		        {
-		           left = ComparisonExpression.createNotInFilter(left, list);
-		        }
-
-        )*
-    )
-    {
-        return left;
-    }
-}
-
-Expression addExpression() :
-{
-    Expression left;
-    Expression right;
-}
-{
-    left = multExpr()
-    (
-	    LOOKAHEAD( ("+"|"-") multExpr())
-	    (
-	        "+" right = multExpr()
-	        {
-	            left = ArithmeticExpression.createPlus(left, right);
-	        }
-	        |
-	        "-" right = multExpr()
-	        {
-	            left = ArithmeticExpression.createMinus(left, right);
-	        }
-        )
-
-    )*
-    {
-        return left;
-    }
-}
-
-Expression multExpr() :
-{
-    Expression left;
-    Expression right;
-}
-{
-    left = unaryExpr()
-    (
-        "*" right = unaryExpr()
-        {
-	        left = ArithmeticExpression.createMultiply(left, right);
-        }
-        |
-        "/" right = unaryExpr()
-        {
-	        left = ArithmeticExpression.createDivide(left, right);
-        }
-        |
-        "%" right = unaryExpr()
-        {
-	        left = ArithmeticExpression.createMod(left, right);
-        }
-
-    )*
-    {
-        return left;
-    }
-}
-
-
-Expression unaryExpr() :
-{
-    String s=null;
-    Expression left=null;
-}
-{
-	(
-		LOOKAHEAD( "+" unaryExpr() )
-	    "+" left=unaryExpr()
-	    |
-	    "-" left=unaryExpr()
-	    {
-	        left = UnaryExpression.createNegate(left);
-	    }
-	    |
-	    <NOT> left=unaryExpr()
-	    {
-		    left = UnaryExpression.createNOT( asBooleanExpression(left) );
-	    }
-	    |	   
-	    left = primaryExpr()
-    )
-    {
-        return left;
-    }
-
-}
-
-Expression primaryExpr() :
-{
-    Expression left=null;
-}
-{
-    (
-        left = literal()
-        |
-        left = variable()
-        |
-        "(" left = orExpression() ")"
-    )
-    {
-        return left;
-    }
-}
-
-
-
-ConstantExpression literal() :
-{
-    Token t;
-    String s;
-    ConstantExpression left=null;
-}
-{
-    (
-        (
-            s = stringLitteral()
-            {
-                left = new ConstantExpression(s);
-            }
-        )
-        |
-        (
-            t = <DECIMAL_LITERAL>
-            {
-            	left = ConstantExpression.createFromDecimal(t.image);
-            }
-        )
-        |
-        (
-            t = <HEX_LITERAL>
-            {
-            	left = ConstantExpression.createFromHex(t.image);
-            }
-        )
-        |
-        (
-            t = <OCTAL_LITERAL>
-            {
-            	left = ConstantExpression.createFromOctal(t.image);
-            }
-        )
-        |
-        (
-            t = <FLOATING_POINT_LITERAL>
-            {
-            	left = ConstantExpression.createFloat(t.image);
-            }
-        )
-        |
-        (
-            <TRUE>
-            {
-                left = ConstantExpression.TRUE;
-            }
-        )
-        |
-        (
-            <FALSE>
-            {
-                left = ConstantExpression.FALSE;
-            }
-        )
-        |
-        (
-            <NULL>
-            {
-                left = ConstantExpression.NULL;
-            }
-        )
-    )
-    {
-        return left;
-    }
-}
-
-String stringLitteral() :
-{
-    Token t;
-    StringBuffer rc = new StringBuffer();
-    boolean first=true;
-}
-{
-    t = <STRING_LITERAL>
-    {
-    	// Decode the sting value.
-    	String image = t.image;
-    	for( int i=1; i < image.length()-1; i++ ) {
-    		char c = image.charAt(i);
-    		if( c == '\'' )
-    			i++;
-   			rc.append(c);
-    	}
-	    return rc.toString();
-    }
-}
-
-PropertyExpression variable() :
-{
-    Token t;
-    StringBuffer rc = new StringBuffer();
-    PropertyExpression left=null;
-}
-{
-    (
-        t = <ID>
-        {
-            left = new PropertyExpression(t.image);
-        }
-        |
-        t = <QUOTED_ID>
-        {
-            // Decode the sting value.
-            String image = t.image;
-            for( int i=1; i < image.length()-1; i++ ) {
-                char c = image.charAt(i);
-                if( c == '"' )
-                    i++;
-                rc.append(c);
-            }
-            return new PropertyExpression(rc.toString());
-        }
-
-    )
-    {
-        return left;
-    }
-}
+import org.apache.qpid.filter.ArithmeticExpression;
+import org.apache.qpid.filter.BooleanExpression;
+import org.apache.qpid.filter.ComparisonExpression;
+import org.apache.qpid.filter.ConstantExpression;
+import org.apache.qpid.filter.Expression;
+import org.apache.qpid.filter.LogicExpression;
+import org.apache.qpid.filter.PropertyExpression;
+import org.apache.qpid.filter.UnaryExpression;
+
+/**
+ * JMS Selector Parser generated by JavaCC
+ *
+ * Do not edit this .java file directly - it is autogenerated from SelectorParser.jj
+ */
+public class SelectorParser {
+
+    public SelectorParser() {
+        this(new StringReader(""));
+    }
+
+    public BooleanExpression parse(String sql) throws AMQInternalException {
+        this.ReInit(new StringReader(sql));
+
+        try {
+            return this.JmsSelector();
+        }
+        catch (Throwable e) {
+	        throw new AMQInternalException(sql,e);
+        }
+
+    }
+
+    private BooleanExpression asBooleanExpression(Expression value) throws ParseException  {
+        if (value instanceof BooleanExpression) {
+            return (BooleanExpression) value;
+        }
+        if (value instanceof PropertyExpression) {
+            return UnaryExpression.createBooleanCast( value );
+        }
+        throw new ParseException("Expression will not result in a boolean value: " + value);
+    }
+
+
+}
+
+PARSER_END(SelectorParser)
+
+// ----------------------------------------------------------------------------
+// Tokens
+// ----------------------------------------------------------------------------
+
+/* White Space */
+SPECIAL_TOKEN :
+{
+  " " | "\t" | "\n" | "\r" | "\f"
+}
+
+/* Comments */
+SKIP:
+{
+  <LINE_COMMENT: "--" (~["\n","\r"])* ("\n"|"\r"|"\r\n") >
+}
+
+SKIP:
+{
+  <BLOCK_COMMENT: "/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/">
+}
+
+/* Reserved Words */
+TOKEN [IGNORE_CASE] :
+{
+    <  NOT     : "NOT">
+  | <  AND     : "AND">
+  | <  OR      : "OR">
+  | <  BETWEEN : "BETWEEN">
+  | <  LIKE    : "LIKE">
+  | <  ESCAPE  : "ESCAPE">
+  | <  IN      : "IN">
+  | <  IS      : "IS">
+  | <  TRUE    : "TRUE" >
+  | <  FALSE   : "FALSE" >
+  | <  NULL    : "NULL" >  
+}
+
+/* Literals */
+TOKEN [IGNORE_CASE] :
+{
+
+    < DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* (["l","L"])? >
+  | < HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
+  | < OCTAL_LITERAL: "0" (["0"-"7"])* >
+  | < FLOATING_POINT_LITERAL:
+          (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? // matches: 5.5 or 5. or 5.5E10 or 5.E10
+        | "." (["0"-"9"])+ (<EXPONENT>)?              // matches: .5 or .5E10
+        | (["0"-"9"])+ <EXPONENT>                     // matches: 5E10
+    >
+  | < #EXPONENT: "E" (["+","-"])? (["0"-"9"])+ >
+  | < STRING_LITERAL: "'" ( ("''") | ~["'"] )*  "'" >
+}
+
+TOKEN [IGNORE_CASE] :
+{
+    < ID : ["a"-"z", "_", "$"] (["a"-"z","0"-"9","_", "$"])* >
+    | < QUOTED_ID : "\"" ( ("\"\"") | ~["\""] )*  "\""  >
+
+}
+
+// ----------------------------------------------------------------------------
+// Grammer
+// ----------------------------------------------------------------------------
+BooleanExpression JmsSelector() :
+{
+    Expression left=null;
+}
+{
+    (
+        left = orExpression()
+    )
+    {
+        return asBooleanExpression(left);
+    }
+
+}
+
+Expression orExpression() :
+{
+    Expression left;
+    Expression right;
+}
+{
+    (
+        left = andExpression()
+        (
+            <OR> right = andExpression()
+            {
+                left = LogicExpression.createOR(asBooleanExpression(left), asBooleanExpression(right));
+            }
+        )*
+    )
+    {
+        return left;
+    }
+
+}
+
+
+Expression andExpression() :
+{
+    Expression left;
+    Expression right;
+}
+{
+    (
+        left = equalityExpression()
+        (
+            <AND> right = equalityExpression()
+            {
+                left = LogicExpression.createAND(asBooleanExpression(left), asBooleanExpression(right));
+            }
+        )*
+    )
+    {
+        return left;
+    }
+}
+
+Expression equalityExpression() :
+{
+    Expression left;
+    Expression right;
+}
+{
+    (
+        left = comparisonExpression()
+        (
+
+            "=" right = comparisonExpression()
+            {
+                left = ComparisonExpression.createEqual(left, right);
+            }
+            |
+            "<>" right = comparisonExpression()
+            {
+                left = ComparisonExpression.createNotEqual(left, right);
+            }
+            |
+            LOOKAHEAD(2)
+            <IS> <NULL>
+            {
+                left = ComparisonExpression.createIsNull(left);
+            }
+            |
+            <IS> <NOT> <NULL>
+            {
+                left = ComparisonExpression.createIsNotNull(left);
+            }
+        )*
+    )
+    {
+        return left;
+    }
+}
+
+Expression comparisonExpression() :
+{
+    Expression left;
+    Expression right;
+    Expression low;
+    Expression high;
+    String t, u;
+	boolean not;
+	ArrayList list;
+}
+{
+    (
+        left = addExpression()
+        (
+
+                ">" right = addExpression()
+                {
+                    left = ComparisonExpression.createGreaterThan(left, right);
+                }
+            |
+                ">=" right = addExpression()
+                {
+                    left = ComparisonExpression.createGreaterThanEqual(left, right);
+                }
+            |
+                "<" right = addExpression()
+                {
+                    left = ComparisonExpression.createLessThan(left, right);
+                }
+            |
+                "<=" right = addExpression()
+                {
+                    left = ComparisonExpression.createLessThanEqual(left, right);
+                }
+           |
+				{
+					u=null;
+				}
+		        <LIKE> t = stringLitteral()
+		        	[ <ESCAPE> u = stringLitteral() ]
+		        {
+                    left = ComparisonExpression.createLike(left, t, u);
+		        }
+           |
+	        	LOOKAHEAD(2)
+				{
+					u=null;
+				}
+		        <NOT> <LIKE> t = stringLitteral() [ <ESCAPE> u = stringLitteral() ]
+		        {
+                    left = ComparisonExpression.createNotLike(left, t, u);
+		        }
+            |
+		        <BETWEEN> low = addExpression() <AND> high = addExpression()
+		        {
+					left = ComparisonExpression.createBetween(left, low, high);
+		        }
+	        |
+	        	LOOKAHEAD(2)
+		        <NOT> <BETWEEN> low = addExpression() <AND> high = addExpression()
+		        {
+					left = ComparisonExpression.createNotBetween(left, low, high);
+		        }
+            |
+				<IN>
+		        "("
+		            t = stringLitteral()
+		            {
+			            list = new ArrayList();
+			            list.add( t );
+		            }
+			        (
+			        	","
+			            t = stringLitteral()
+			            {
+				            list.add( t );
+			            }
+
+			        )*
+		        ")"
+		        {
+		           left = ComparisonExpression.createInFilter(left, list);
+		        }
+            |
+	        	LOOKAHEAD(2)
+	            <NOT> <IN>
+		        "("
+		            t = stringLitteral()
+		            {
+			            list = new ArrayList();
+			            list.add( t );
+		            }
+			        (
+			        	","
+			            t = stringLitteral()
+			            {
+				            list.add( t );
+			            }
+
+			        )*
+		        ")"
+		        {
+		           left = ComparisonExpression.createNotInFilter(left, list);
+		        }
+
+        )*
+    )
+    {
+        return left;
+    }
+}
+
+Expression addExpression() :
+{
+    Expression left;
+    Expression right;
+}
+{
+    left = multExpr()
+    (
+	    LOOKAHEAD( ("+"|"-") multExpr())
+	    (
+	        "+" right = multExpr()
+	        {
+	            left = ArithmeticExpression.createPlus(left, right);
+	        }
+	        |
+	        "-" right = multExpr()
+	        {
+	            left = ArithmeticExpression.createMinus(left, right);
+	        }
+        )
+
+    )*
+    {
+        return left;
+    }
+}
+
+Expression multExpr() :
+{
+    Expression left;
+    Expression right;
+}
+{
+    left = unaryExpr()
+    (
+        "*" right = unaryExpr()
+        {
+	        left = ArithmeticExpression.createMultiply(left, right);
+        }
+        |
+        "/" right = unaryExpr()
+        {
+	        left = ArithmeticExpression.createDivide(left, right);
+        }
+        |
+        "%" right = unaryExpr()
+        {
+	        left = ArithmeticExpression.createMod(left, right);
+        }
+
+    )*
+    {
+        return left;
+    }
+}
+
+
+Expression unaryExpr() :
+{
+    String s=null;
+    Expression left=null;
+}
+{
+	(
+		LOOKAHEAD( "+" unaryExpr() )
+	    "+" left=unaryExpr()
+	    |
+	    "-" left=unaryExpr()
+	    {
+	        left = UnaryExpression.createNegate(left);
+	    }
+	    |
+	    <NOT> left=unaryExpr()
+	    {
+		    left = UnaryExpression.createNOT( asBooleanExpression(left) );
+	    }
+	    |	   
+	    left = primaryExpr()
+    )
+    {
+        return left;
+    }
+
+}
+
+Expression primaryExpr() :
+{
+    Expression left=null;
+}
+{
+    (
+        left = literal()
+        |
+        left = variable()
+        |
+        "(" left = orExpression() ")"
+    )
+    {
+        return left;
+    }
+}
+
+
+
+ConstantExpression literal() :
+{
+    Token t;
+    String s;
+    ConstantExpression left=null;
+}
+{
+    (
+        (
+            s = stringLitteral()
+            {
+                left = new ConstantExpression(s);
+            }
+        )
+        |
+        (
+            t = <DECIMAL_LITERAL>
+            {
+            	left = ConstantExpression.createFromDecimal(t.image);
+            }
+        )
+        |
+        (
+            t = <HEX_LITERAL>
+            {
+            	left = ConstantExpression.createFromHex(t.image);
+            }
+        )
+        |
+        (
+            t = <OCTAL_LITERAL>
+            {
+            	left = ConstantExpression.createFromOctal(t.image);
+            }
+        )
+        |
+        (
+            t = <FLOATING_POINT_LITERAL>
+            {
+            	left = ConstantExpression.createFloat(t.image);
+            }
+        )
+        |
+        (
+            <TRUE>
+            {
+                left = ConstantExpression.TRUE;
+            }
+        )
+        |
+        (
+            <FALSE>
+            {
+                left = ConstantExpression.FALSE;
+            }
+        )
+        |
+        (
+            <NULL>
+            {
+                left = ConstantExpression.NULL;
+            }
+        )
+    )
+    {
+        return left;
+    }
+}
+
+String stringLitteral() :
+{
+    Token t;
+    StringBuffer rc = new StringBuffer();
+    boolean first=true;
+}
+{
+    t = <STRING_LITERAL>
+    {
+    	// Decode the sting value.
+    	String image = t.image;
+    	for( int i=1; i < image.length()-1; i++ ) {
+    		char c = image.charAt(i);
+    		if( c == '\'' )
+    			i++;
+   			rc.append(c);
+    	}
+	    return rc.toString();
+    }
+}
+
+PropertyExpression variable() :
+{
+    Token t;
+    StringBuffer rc = new StringBuffer();
+    PropertyExpression left=null;
+}
+{
+    (
+        t = <ID>
+        {
+            left = new PropertyExpression(t.image);
+        }
+        |
+        t = <QUOTED_ID>
+        {
+            // Decode the sting value.
+            String image = t.image;
+            for( int i=1; i < image.length()-1; i++ ) {
+                char c = image.charAt(i);
+                if( c == '"' )
+                    i++;
+                rc.append(c);
+            }
+            return new PropertyExpression(rc.toString());
+        }
+
+    )
+    {
+        return left;
+    }
+}



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org