activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r485230 - /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompMessage.h
Date Sun, 10 Dec 2006 18:27:49 GMT
Author: tabish
Date: Sun Dec 10 10:27:48 2006
New Revision: 485230

URL: http://svn.apache.org/viewvc?view=rev&rev=485230
Log:
http://issues.apache.org/activemq/browse/AMQCPP-23

Change the delivery mode function to turn the property internally into true / false string.

Modified:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompMessage.h

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompMessage.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompMessage.h?view=diff&rev=485230&r1=485229&r2=485230
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompMessage.h
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompMessage.h
Sun Dec 10 10:27:48 2006
@@ -290,9 +290,13 @@
                 return cms::DeliveryMode::PERSISTANT;
             }
             
-            return util::Integer::parseInt( getPropertyValue( 
+            if( util::Boolean::parseBoolean( getPropertyValue( 
                        CommandConstants::toString( 
-                           CommandConstants::HEADER_PERSISTANT ) ) );
+                           CommandConstants::HEADER_PERSISTANT ) ) ) == true ) {
+                return (int)cms::DeliveryMode::PERSISTANT;
+            }
+            
+            return cms::DeliveryMode::NON_PERSISTANT;
         }
 
         /**
@@ -300,10 +304,16 @@
          * @param mode DeliveryMode enumerated value.
          */
         virtual void setCMSDeliveryMode( int mode ) {
+            std::string persistant = "true"; 
+            
+            if( mode == (int)cms::DeliveryMode::NON_PERSISTANT ) {
+                persistant = "false";
+            }
+            
             setPropertyValue( 
                 CommandConstants::toString( 
                     CommandConstants::HEADER_PERSISTANT ) ,
-                util::Integer::toString( mode ) );
+                persistant );            
         }
       
         /**



Mime
View raw message