activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r687332 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
Date Wed, 20 Aug 2008 13:44:02 GMT
Author: jstrachan
Date: Wed Aug 20 06:44:02 2008
New Revision: 687332

URL: http://svn.apache.org/viewvc?rev=687332&view=rev
Log:
Added support for JMSDeliveryMode header being set generically

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java?rev=687332&r1=687331&r2=687332&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/command/ActiveMQMessage.java
Wed Aug 20 06:44:02 2008
@@ -325,6 +325,21 @@
                 ((ActiveMQMessage) message).setJMSCorrelationID(rc);
             }
         });
+        JMS_PROPERTY_SETERS.put("JMSDeliveryMode", new PropertySetter() {
+            public void set(Message message, Object value) throws MessageFormatException
{
+                Integer rc = (Integer) TypeConversionSupport.convert(value, Integer.class);
+                if (rc == null) {
+                    Boolean bool = (Boolean) TypeConversionSupport.convert(value, Boolean.class);
+                    if (bool == null) {
+                        throw new MessageFormatException("Property JMSDeliveryMode cannot
be set from a " + value.getClass().getName() + ".");
+                    }
+                    else {
+                        rc = bool.booleanValue() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
+                    }
+                }
+                ((ActiveMQMessage) message).setJMSDeliveryMode(rc);
+            }
+        });
         JMS_PROPERTY_SETERS.put("JMSExpiration", new PropertySetter() {
             public void set(Message message, Object value) throws MessageFormatException
{
                 Long rc = (Long) TypeConversionSupport.convert(value, Long.class);



Mime
View raw message