activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r528222 [1/5] - in /activemq/activemq-cpp/trunk/activemq-cpp/src: examples/ main/ main/activemq/connector/openwire/ main/activemq/connector/openwire/commands/ main/activemq/connector/stomp/ main/activemq/connector/stomp/commands/ main/activ...
Date Thu, 12 Apr 2007 20:29:43 GMT
Author: tabish
Date: Thu Apr 12 13:29:39 2007
New Revision: 528222

URL: http://svn.apache.org/viewvc?view=rev&rev=528222
Log:
https://issues.apache.org/activemq/browse/AMQCPP-65
http://issues.apache.org/activemq/browse/AMQCPP-66


Added:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportBuilder.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportBuilder.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/AsyncSendTransport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/AsyncSendTransport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/AsyncSendTransportFactory.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/AsyncSendTransportFactory.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/FutureResponse.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/LoggingTransport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/LoggingTransport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/LoggingTransportFactory.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/LoggingTransportFactory.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/ResponseCorrelator.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/ResponseCorrelator.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/ResponseCorrelatorFactory.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/ResponseCorrelatorFactory.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/TcpTransport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/TcpTransport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/TcpTransportFactory.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/filters/TcpTransportFactory.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompResponseBuilder.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/DummyTransport.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/filters/
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/filters/ResponseCorrelatorTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/filters/ResponseCorrelatorTest.h
Removed:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/FutureResponse.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/LoggingTransport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/LoggingTransport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/ResponseCorrelator.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/ResponseCorrelator.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TcpTransport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TcpTransport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TcpTransportFactory.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TcpTransportFactory.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/ResponseCorrelatorTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/ResponseCorrelatorTest.h
Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompFrame.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbortCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BeginCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommitCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectedCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/DisconnectCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ErrorCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/MessageCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ReceiptCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/SubscribeCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/TextMessageCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/UnsubscribeCommand.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionFactory.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnectionFactory.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/SocketFactory.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/SocketFactory.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/support/InitDirector.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/Command.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/CommandIOException.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/CommandListener.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/CommandReader.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/CommandWriter.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/IOTransport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/IOTransport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/IOTransportFactory.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/IOTransportFactory.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/Response.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/Transport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportExceptionListener.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFactory.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFactoryMap.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFactoryMap.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFactoryMapRegistrar.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireAsyncSenderTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/AsyncSenderTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompResponseBuilder.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQConnectionFactoryTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQConnectionFactoryTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQConnectionTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQConnectionTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/network/SocketFactoryTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/network/SocketFactoryTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/DummyTransport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/DummyTransportFactory.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/DummyTransportFactory.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/IOTransportTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/TransportFactoryMapRegistrarTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/transport/TransportFactoryMapTest.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp Thu Apr 12 13:29:39 2007
@@ -294,9 +294,10 @@
     // tightMarshalling or tcp logging etc.
     std::string brokerURI =
         "tcp://127.0.0.1:61616"
-        "?wireFormat=openwire";
-//        "&commandTracingEnabled=true"
-//        "&tcpTracingEnabled=true"
+        "?wireFormat=openwire"
+        "&transport.useAsyncSend=true";
+//        "&transport.commandTracingEnabled=true"
+//        "&transport.tcpTracingEnabled=true";
 //        "&wireFormat.tightEncodingEnabled=true";
 
     //============================================================

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am Thu Apr 12 13:29:39 2007
@@ -74,14 +74,19 @@
     activemq/network/SocketOutputStream.cpp \
     activemq/network/SocketFactory.cpp \
     activemq/network/SocketError.cpp \
-    activemq/transport/IOTransportFactory.cpp \
-    activemq/transport/ResponseCorrelator.cpp \
-    activemq/transport/TcpTransport.cpp \
-    activemq/transport/IOTransport.cpp \
+    activemq/transport/TransportBuilder.cpp \
     activemq/transport/TransportFactoryMap.cpp \
-    activemq/transport/TcpTransportFactory.cpp \
     activemq/transport/TransportFilter.cpp \
-    activemq/transport/LoggingTransport.cpp \
+    activemq/transport/IOTransportFactory.cpp \
+    activemq/transport/IOTransport.cpp \
+    activemq/transport/filters/ResponseCorrelator.cpp \
+    activemq/transport/filters/ResponseCorrelatorFactory.cpp \
+    activemq/transport/filters/AsyncSendTransport.cpp \
+    activemq/transport/filters/AsyncSendTransportFactory.cpp \
+    activemq/transport/filters/TcpTransport.cpp \
+    activemq/transport/filters/TcpTransportFactory.cpp \
+    activemq/transport/filters/LoggingTransport.cpp \
+    activemq/transport/filters/LoggingTransportFactory.cpp \
     activemq/util/StringTokenizer.cpp \
     activemq/util/Guid.cpp \
     activemq/util/Endian.cpp \
@@ -236,25 +241,30 @@
     activemq/network/SocketOutputStream.h \
     activemq/network/SocketFactory.h \
     activemq/network/SocketError.h \
-    activemq/transport/IOTransportFactory.h \
+    activemq/transport/TransportBuilder.h \
     activemq/transport/Transport.h \
+    activemq/transport/TransportFilter.h \
     activemq/transport/TransportFactory.h \
-    activemq/transport/CommandListener.h \
-    activemq/transport/ResponseCorrelator.h \
-    activemq/transport/IOTransport.h \
-    activemq/transport/TcpTransport.h \
     activemq/transport/TransportExceptionListener.h \
-    activemq/transport/CommandReader.h \
-    activemq/transport/TcpTransportFactory.h \
-    activemq/transport/Command.h \
-    activemq/transport/CommandWriter.h \
     activemq/transport/TransportFactoryMapRegistrar.h \
     activemq/transport/TransportFactoryMap.h \
-    activemq/transport/FutureResponse.h \
     activemq/transport/Response.h \
+    activemq/transport/Command.h \
+    activemq/transport/CommandListener.h \
+    activemq/transport/CommandReader.h \
+    activemq/transport/CommandWriter.h \
     activemq/transport/CommandIOException.h \
-    activemq/transport/TransportFilter.h \
-    activemq/transport/LoggingTransport.h \
+    activemq/transport/IOTransportFactory.h \
+    activemq/transport/IOTransport.h \
+    activemq/transport/filters/FutureResponse.h \
+    activemq/transport/filters/ResponseCorrelator.h \
+    activemq/transport/filters/ResponseCorrelatorFactory.h \
+    activemq/transport/filters/AsyncSendTransport.h \
+    activemq/transport/filters/AsyncSendTransportFactory.h \
+    activemq/transport/filters/TcpTransport.h \
+    activemq/transport/filters/TcpTransportFactory.h \
+    activemq/transport/filters/LoggingTransport.h \
+    activemq/transport/filters/LoggingTransportFactory.h \
     activemq/util/Endian.h \
     activemq/util/Number.h \
     activemq/util/Config.h \

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.cpp?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.cpp Thu Apr 12 13:29:39 2007
@@ -32,7 +32,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 OpenWireFormatNegotiator::OpenWireFormatNegotiator( OpenWireFormat* openWireFormat,
                                                     Transport* next,
-                                                    const bool own ) :
+                                                    bool own ) :
     TransportFilter( next, own ),
     wireInfoSentDownLatch(1),
     readyCountDownLatch(1)

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.h Thu Apr 12 13:29:39 2007
@@ -29,8 +29,7 @@
 namespace connector{
 namespace openwire{
 
-    class OpenWireFormatNegotiator : public transport::TransportFilter
-    {
+    class OpenWireFormatNegotiator : public transport::TransportFilter {
     private:
 
         /**
@@ -69,7 +68,7 @@
          */
         OpenWireFormatNegotiator( OpenWireFormat* openWireFormat,
                                   transport::Transport* next,
-                                  const bool own = true );
+                                  bool own = true );
 
         virtual ~OpenWireFormatNegotiator();
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/BaseCommand.h Thu Apr 12 13:29:39 2007
@@ -73,6 +73,15 @@
         }
 
         /**
+         * Returns a Cloned copy of this command, the caller is responsible
+         * for deallocating the returned object.
+         * @returns new copy of this command.
+         */
+        virtual transport::Command* cloneCommand() const {
+            return dynamic_cast<transport::Command*>( this->cloneDataStructure() );
+        }
+
+        /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/WireFormatInfo.cpp Thu Apr 12 13:29:39 2007
@@ -71,6 +71,9 @@
             __FILE__, __LINE__,
             "WireFormatInfo::copyDataStructure - src is NULL or invalid" );
     }
+
+    this->properties.copy( srcPtr->getProperties() );
+    this->version = srcPtr->getVersion();
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompFrame.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompFrame.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompFrame.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/StompFrame.h Thu Apr 12 13:29:39 2007
@@ -17,7 +17,7 @@
 
 #ifndef ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMEWRAPPER_H_
 #define ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMEWRAPPER_H_
- 
+
 #include <string>
 #include <string.h>
 #include <map>
@@ -31,19 +31,19 @@
      * A Stomp-level message frame that encloses all messages
      * to and from the broker.
      */
-    class StompFrame{           
+    class StompFrame{
     public:
-    
+
         /**
          * Default constructor.
          */
         StompFrame(){}
-        
+
         /**
          * Destruction.
          */
         virtual ~StompFrame() {}
-        
+
         /**
          * Clonse this message exactly, returns a new instance that the
          * caller is required to delete.
@@ -51,12 +51,22 @@
          */
         virtual StompFrame* clone() const {
             StompFrame* frame = new StompFrame();
-            frame->command = command;
-            frame->properties = properties;
-            frame->body = body;
+            frame->copy( this );
             return frame;
         }
-        
+
+        /**
+         * Copies the contents of the passed Frame to this one
+         * @param src - Frame to copy
+         */
+        virtual void copy( const StompFrame* src ) {
+
+            this->setCommand( src->getCommand() );
+            this->properties.copy( &( src->getProperties() ) );
+            // Use the Vectors assignment operator.
+            this->body = src->getBody();
+        }
+
         /**
          * Sets the command for this stomp frame.
          * @param cmd command The command to be set.
@@ -64,23 +74,23 @@
         void setCommand( const std::string& cmd ){
             this->command = cmd;
         }
-        
+
         /**
          * Accessor for this frame's command field.
          */
         const std::string& getCommand() const{
             return command;
         }
-        
+
         /**
          * Gets access to the header properties for this frame.
          * @return the Properties object owned by this Frame
          */
         util::Properties& getProperties(){ return properties; }
-        const util::Properties& getProperties() const { 
+        const util::Properties& getProperties() const {
             return properties;
         }
-        
+
         /**
          * Accessor for the body data of this frame.
          * @return char pointer to body data
@@ -88,37 +98,37 @@
         const std::vector<unsigned char>& getBody() const{
             return body;
         }
-        
+
         /**
          * Non-const version of the body accessor.
          */
         std::vector<unsigned char>& getBody(){
             return body;
         }
-        
+
         /**
          * Return the number of bytes contained in this frames body
          * @return Body bytes length.
          */
         std::size_t getBodyLength() const{ return body.size(); }
-        
+
         /**
          * Sets the body data of this frame as a byte sequence.
          * @param bytes The byte buffer to be set in the body.
          * @param numBytes The number of bytes in the buffer.
          */
         void setBody( const unsigned char* bytes, std::size_t numBytes ){
-            
+
             // Remove old data
             body.clear();
-           
+
             // Copy data to internal buffer.
             for( std::size_t ix = 0; ix < numBytes; ++ix )
             {
                 body.push_back(bytes[ix]);
             }
-        }   
-        
+        }
+
     private:
 
         // String Name of this command.
@@ -128,9 +138,9 @@
         util::SimpleProperties properties;
 
         // Byte data of Body.
-        std::vector<unsigned char> body;         
+        std::vector<unsigned char> body;
     };
-    
+
 }}}
 
 #endif /*ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMEWRAPPER_H_*/

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbortCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbortCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbortCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbortCommand.h Thu Apr 12 13:29:39 2007
@@ -35,18 +35,26 @@
     {
     public:
 
-        AbortCommand(void) :
+        AbortCommand() :
             AbstractCommand<transport::Command>() {
                 initialize( getFrame() );
         }
-        AbortCommand( StompFrame* frame ) : 
+        AbortCommand( StompFrame* frame ) :
             AbstractCommand<transport::Command>(frame) {
                 validate( getFrame() );
         }
         virtual ~AbortCommand(void) {}
-        
+
+        /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return new AbortCommand( getFrame().clone() );
+        }
+
     protected:
-    
+
         /**
          * Inheritors are required to override this method to init the
          * frame with data appropriate for the command type.
@@ -59,17 +67,17 @@
         }
 
         /**
-         * Inheritors are required to override this method to validate 
+         * Inheritors are required to override this method to validate
          * the passed stomp frame before it is marshalled or unmarshaled
          * @param frame the Frame to validate
          * @returns true if frame is valid
          */
         virtual bool validate( const StompFrame& frame ) const
         {
-            if((frame.getCommand() == 
+            if((frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::ABORT ) ) &&
                (frame.getProperties().hasProperty(
-                    CommandConstants::toString( 
+                    CommandConstants::toString(
                         CommandConstants::HEADER_TRANSACTIONID ) ) ) )
             {
                 return true;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AbstractCommand.h Thu Apr 12 13:29:39 2007
@@ -14,12 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #ifndef ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABSTRACTCOMMAND_H_
 #define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABSTRACTCOMMAND_H_
 
 #include <activemq/connector/stomp/StompFrame.h>
 #include <activemq/connector/stomp/commands/StompCommand.h>
+#include <activemq/transport/Command.h>
 #include <activemq/exceptions/NullPointerException.h>
 #include <activemq/util/Integer.h>
 #include <activemq/util/Long.h>
@@ -32,28 +33,28 @@
 namespace connector{
 namespace stomp{
 namespace commands{
-    
+
     /**
      * Interface for all Stomp commands.  Commands wrap
      * around a stomp frame and provide their own marshalling
      * to and from frames.  Stomp frame objects are dumb and have
      * a generic interface that becomes cumbersome to use directly.
      * Commands help to abstract the stomp frame by providing a
-     * more user-friendly interface to the frame content.  
+     * more user-friendly interface to the frame content.
      */
     template<typename T>
     class AbstractCommand
-    : 
+    :
         public StompCommand,
         public T
     {
     protected:
-    
+
         // Frame that contains the actual message
         StompFrame* frame;
 
     protected:
-    
+
         StompFrame& getFrame() {
             if( frame == NULL ){
                 throw exceptions::NullPointerException(
@@ -63,7 +64,7 @@
 
             return *frame;
         }
-        
+
         const StompFrame& getFrame() const {
             if( frame == NULL ){
                 throw exceptions::NullPointerException(
@@ -73,7 +74,7 @@
 
             return *frame;
         }
-        
+
         void destroyFrame()
         {
             if( frame != NULL ){
@@ -81,22 +82,22 @@
                 frame = NULL;
             }
         }
-    
+
         const char* getPropertyValue( const std::string& name ) const{
             return getFrame().getProperties().getProperty( name );
         }
 
-        const std::string getPropertyValue( 
-            const std::string& name, 
+        const std::string getPropertyValue(
+            const std::string& name,
             const std::string& defReturn ) const {
-            return getFrame().getProperties().getProperty( 
+            return getFrame().getProperties().getProperty(
                 name, defReturn );
         }
-        
+
         void setPropertyValue( const std::string& name, const std::string& value ){
             getFrame().getProperties().setProperty( name, value );
         }
-        
+
         /**
          * Inheritors are required to override this method to init the
          * frame with data appropriate for the command type.
@@ -105,65 +106,65 @@
         virtual void initialize( StompFrame& frame ) = 0;
 
         /**
-         * Inheritors are required to override this method to validate 
+         * Inheritors are required to override this method to validate
          * the passed stomp frame before it is marshalled or unmarshaled
          * @param frame the Frame to validate
          * @returns true if frame is valid
          */
         virtual bool validate( const StompFrame& frame ) const = 0;
-        
+
         /**
          * Returns a provider-specific string that provides information
          * about the contents of the command.
          */
         virtual std::string toString() const {
-            
+
             std::ostringstream ostream;
             ostream << "<STOMP-COMMAND class=" << typeid(*this).name() << ">" << std::endl;
-            
+
             std::string propertyString = getProperties().toString();
             ostream << propertyString;
-            
+
             const std::vector<unsigned char>& bytes = getBytes();
             ostream << "<STOMP-BODY numBytes=" << (int)bytes.size() << ">";
-            
+
             for( std::size_t ix=0; ix<bytes.size(); ++ix ){
                 char c = (char)bytes[ix];
                 if( util::Character::isLetterOrDigit(c) || util::Character::isWhitespace(c) ){
                     ostream << c;
                 }
-                else 
+                else
                     ostream << "[" << (int)(unsigned char)c << "]";
             }
-            
+
             ostream << "</STOMP-BODY>";
             ostream << std::endl << "</STOMP-COMMAND>";
-            
+
             return ostream.str();
         }
-        
+
     public:
-    
-        AbstractCommand(){ 
+
+        AbstractCommand(){
             frame = new StompFrame;
         }
-        AbstractCommand( StompFrame* frame ){ 
+        AbstractCommand( StompFrame* frame ){
             this->frame = frame;
         }
         virtual ~AbstractCommand(){
             destroyFrame();
         }
-        
+
         /**
          * Gets the properties map for this command.
          * @return Reference to a Properties object
          */
         virtual util::Properties& getProperties(){
             return getFrame().getProperties();
-        }   
+        }
         virtual const util::Properties& getProperties() const{
             return getFrame().getProperties();
-        }   
+        }
 
         /**
          * Default implementation - does nothing.
@@ -183,11 +184,11 @@
         virtual int getCommandId() const {
             return util::Integer::parseInt(
                 getPropertyValue(
-                    CommandConstants::toString( 
+                    CommandConstants::toString(
                         CommandConstants::HEADER_REQUESTID ),
                     "0" ) );
         }
-        
+
         /**
          * Not used by stomp.
          * @param required true if response is required
@@ -195,17 +196,17 @@
         virtual void setResponseRequired( const bool required AMQCPP_UNUSED) {
             /* does nothing */
         }
-        
+
         /**
          * Is a Response required for this Command
          * @return true if a response is required.
          */
         virtual bool isResponseRequired() const {
-            return frame->getProperties().hasProperty( 
-                CommandConstants::toString( 
+            return frame->getProperties().hasProperty(
+                CommandConstants::toString(
                     CommandConstants::HEADER_REQUESTID) );
         }
-        
+
         /**
          * Gets the Correlation Id that is associated with this message
          * @return the Correlation Id
@@ -213,7 +214,7 @@
         virtual int getCorrelationId() const {
             return util::Integer::parseInt(
                 getPropertyValue(
-                    CommandConstants::toString( 
+                    CommandConstants::toString(
                         CommandConstants::HEADER_RESPONSEID ),
                      "0" ) );
         }
@@ -225,14 +226,14 @@
         virtual void setCorrelationId( int corrId AMQCPP_UNUSED ) {
             /* do nothing */
         }
-        
+
         /**
          * Get the Transaction Id of this Command
          * @return the Id of the Transaction
-         */      
+         */
         virtual std::string getTransactionId() const{
-            return getPropertyValue( 
-                CommandConstants::toString( 
+            return getPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_TRANSACTIONID ), "" );
         }
 
@@ -241,11 +242,11 @@
          * @param id the Id of the Transaction
          */
         virtual void setTransactionId( const std::string& id ){
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_TRANSACTIONID),
                 id );
-        }  
+        }
 
         /**
          * Retrieve the Stomp Command Id for this message.
@@ -255,7 +256,7 @@
             return CommandConstants::toCommandId(
                 getFrame().getCommand() );
         }
-        
+
         /**
          * Marshals the command to a stomp frame.
          * @returns the stomp frame representation of this
@@ -267,14 +268,23 @@
             throw (marshal::MarshalException)
         {
             if( frame == NULL || !validate( *frame ) ){
-                throw marshal::MarshalException( 
+                throw marshal::MarshalException(
                     __FILE__, __LINE__,
                     "AbstractCommand::marshal() - frame invalid" );
             }
-            
+
             return getFrame();
         }
 
+        /**
+         * Returns a Cloned copy of this command, the caller is responsible
+         * for deallocating the returned object.
+         * @returns new copy of this command.
+         */
+        virtual transport::Command* cloneCommand() const {
+            return dynamic_cast<transport::Command*>( this->cloneStompCommand() );
+        }
+
     protected:
 
         /**
@@ -292,32 +302,32 @@
         virtual const std::vector<unsigned char>& getBytes() const{
             return getFrame().getBody();
         }
-        
+
         virtual std::vector<unsigned char>& getBytes(){
             return getFrame().getBody();
         }
-    
+
         /**
          * Set the bytes that are to be sent in the body of this message
          * the content length flag indicates if the Content Length header
          * should be set.
          * @param bytes to store
          * @param numBytes number of bytes to pull from the bytes buffer
-         * @param setContentLength true if the content length header should 
+         * @param setContentLength true if the content length header should
          * be set
          */
-        virtual void setBytes( const unsigned char* bytes, 
+        virtual void setBytes( const unsigned char* bytes,
                                std::size_t numBytes )
         {
             getFrame().setBody( bytes, numBytes );
         }
-        
+
         virtual void setBytes( const std::vector<unsigned char>& bytes )
         {
             getFrame().getBody() = bytes;
         }
     };
-    
+
 }}}}
 
 #endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABSTRACTCOMMAND_H_*/

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h Thu Apr 12 13:29:39 2007
@@ -31,7 +31,7 @@
      * Stomp Command that Represents Acknowledgement of a message
      * receive.  The Ack Command has one required attribute, message
      * Id.  For each message sent to the client from the broker, the
-     * message will not be considered consumed until an Ack is sent.  
+     * message will not be considered consumed until an Ack is sent.
      * Optionally a Transaction Id can be set that indicates that the
      * message acknowledgement should be part of a named transaction.
      */
@@ -39,39 +39,47 @@
     {
     public:
 
-        AckCommand(void) :
+        AckCommand() :
             AbstractCommand<transport::Command>() {
                 initialize( getFrame() );
         }
-        AckCommand( StompFrame* frame ) : 
+        AckCommand( StompFrame* frame ) :
             AbstractCommand<transport::Command>( frame ) {
                 validate( getFrame() );
         }
-        virtual ~AckCommand(void) {}
-      
+        virtual ~AckCommand() {}
+
         /**
          * Get the Message Id of this Command
          * @return the Id of the Message
-         */      
-        virtual std::string getMessageId(void) const{
-            return getPropertyValue( 
-                CommandConstants::toString( 
+         */
+        virtual std::string getMessageId() const{
+            return getPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_MESSAGEID ), "" );
         }
-      
+
         /**
          * Set the Message Id that this Ack is associated with
          * @param messageId the Message Id
          */
         virtual void setMessageId( const std::string& messageId ){
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_MESSAGEID ),
                 messageId );
         }
 
+        /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return new AckCommand( getFrame().clone() );
+        }
+
     protected:
-    
+
         /**
          * Inheritors are required to override this method to init the
          * frame with data appropriate for the command type.
@@ -84,7 +92,7 @@
         }
 
         /**
-         * Inheritors are required to override this method to validate 
+         * Inheritors are required to override this method to validate
          * the passed stomp frame before it is marshalled or unmarshaled
          * @param frame Frame to validate
          * @returns true if frame is valid
@@ -92,14 +100,14 @@
         virtual bool validate( const StompFrame& frame ) const
         {
             // Make sure the message is an ACK message.
-            bool isAck = frame.getCommand() == 
+            bool isAck = frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::ACK );
-                       
+
             // Make sure it has a message ID header.
             bool hasMessageId = frame.getProperties().hasProperty(
-                   CommandConstants::toString( 
+                   CommandConstants::toString(
                        CommandConstants::HEADER_MESSAGEID ) );
-            
+
             if( isAck && hasMessageId )
             {
                 return true;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BeginCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BeginCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BeginCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BeginCommand.h Thu Apr 12 13:29:39 2007
@@ -26,32 +26,42 @@
 namespace connector{
 namespace stomp{
 namespace commands{
-    
+
     /**
      * Begins a Transaction.  Transactions in this case apply to
      * sending and acknowledging -- any messages sent or acknowledged
      * during a transaction will be handled atomically based on the
      * transaction.
-     * 
+     *
      * A transaction Identifier is required and this id will be used
      * for all sends, commits, aborts, or acks.
      */
     class BeginCommand : public AbstractCommand< transport::Command >
     {
     public:
-   
-        BeginCommand(void) :
+
+        BeginCommand() :
             AbstractCommand<transport::Command>() {
                 initialize( getFrame() );
         }
-        BeginCommand( StompFrame* frame ) : 
+
+        BeginCommand( StompFrame* frame ) :
             AbstractCommand<transport::Command>( frame ) {
                 validate( getFrame() );
         }
-        virtual ~BeginCommand(void) {}
+
+        virtual ~BeginCommand() {}
+
+        /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return new BeginCommand( getFrame().clone() );
+        }
 
     protected:
-    
+
         /**
          * Inheritors are required to override this method to init the
          * frame with data appropriate for the command type.
@@ -64,17 +74,17 @@
         }
 
         /**
-         * Inheritors are required to override this method to validate 
+         * Inheritors are required to override this method to validate
          * the passed stomp frame before it is marshalled or unmarshaled
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
         virtual bool validate( const StompFrame& frame ) const
         {
-            if((frame.getCommand() == 
+            if((frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::BEGIN )) &&
                (frame.getProperties().hasProperty(
-                    CommandConstants::toString( 
+                    CommandConstants::toString(
                         CommandConstants::HEADER_TRANSACTIONID ) ) ) )
             {
                 return true;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/BytesMessageCommand.h Thu Apr 12 13:29:39 2007
@@ -100,6 +100,14 @@
         virtual ~BytesMessageCommand() {}
 
         /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return dynamic_cast<StompCommand*>( this->clone() );
+        }
+
+        /**
          * Clears out the body of the message.  This does not clear the
          * headers or properties.
          */

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommitCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommitCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommitCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/CommitCommand.h Thu Apr 12 13:29:39 2007
@@ -27,26 +27,36 @@
 namespace connector{
 namespace stomp{
 namespace commands{
-    
+
     /**
      * Commits a Transaction.
      */
     class CommitCommand  : public AbstractCommand< transport::Command >
     {
     public:
-   
-        CommitCommand(void) :
+
+        CommitCommand() :
             AbstractCommand<transport::Command>() {
                 initialize( getFrame() );
         }
-        CommitCommand( StompFrame* frame ) : 
+
+        CommitCommand( StompFrame* frame ) :
             AbstractCommand<transport::Command>( frame ) {
                 validate( getFrame() );
         }
-        virtual ~CommitCommand(void) {}
+
+        virtual ~CommitCommand() {}
+
+        /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return new CommitCommand( getFrame().clone() );
+        }
 
     protected:
-    
+
         /**
          * Inheritors are required to override this method to init the
          * frame with data appropriate for the command type.
@@ -59,17 +69,17 @@
         }
 
         /**
-         * Inheritors are required to override this method to validate 
+         * Inheritors are required to override this method to validate
          * the passed stomp frame before it is marshalled or unmarshaled
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
         virtual bool validate( const StompFrame& frame ) const
         {
-            if((frame.getCommand() == 
+            if((frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::COMMIT )) &&
                (frame.getProperties().hasProperty(
-                    CommandConstants::toString( 
+                    CommandConstants::toString(
                         CommandConstants::HEADER_TRANSACTIONID ) ) ) )
             {
                 return true;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectCommand.h Thu Apr 12 13:29:39 2007
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #ifndef ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_CONNECTCOMMAND_H_
 #define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_CONNECTCOMMAND_H_
 
@@ -26,7 +26,7 @@
 namespace connector{
 namespace stomp{
 namespace commands{
-    
+
     /**
      * Message sent to the broker to connect.
      */
@@ -34,15 +34,25 @@
     {
     public:
 
-        ConnectCommand(void) :
+        ConnectCommand() :
             AbstractCommand<transport::Command>() {
                 initialize( getFrame() );
         }
-        ConnectCommand( StompFrame* frame ) : 
+
+        ConnectCommand( StompFrame* frame ) :
             AbstractCommand<transport::Command>( frame ) {
                 validate( getFrame() );
         }
-        virtual ~ConnectCommand(void) {};
+
+        virtual ~ConnectCommand() {};
+
+        /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return new ConnectCommand( getFrame().clone() );
+        }
 
         /**
          * Sets the Command Id of this Message
@@ -50,49 +60,49 @@
          */
         virtual void setCommandId( const unsigned int id ){
             setPropertyValue(
-                CommandConstants::toString( 
+                CommandConstants::toString(
                     CommandConstants::HEADER_REQUESTID),
                  util::Integer::toString( id ) );
         }
-        
+
         /**
          * Get the login
          * @return char* to login, can be ""
-         */      
-        virtual const char* getLogin(void) const {
-            return getPropertyValue( 
-                CommandConstants::toString( 
+         */
+        virtual const char* getLogin() const {
+            return getPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_LOGIN) );
         }
-      
+
         /**
          * Set the login
          * @param login username string value
          */
         virtual void setLogin( const std::string& login ){
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_LOGIN) ,
                 login );
         }
-      
+
         /**
          * Get the password
          * @return char* to password, can be ""
-         */      
-        virtual const char* getPassword(void) const{
-            return getPropertyValue( 
-                CommandConstants::toString( 
+         */
+        virtual const char* getPassword() const{
+            return getPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_PASSWORD) );
         }
-      
+
         /**
          * Set the password
          * @param password the passwrod string value
          */
         virtual void setPassword( const std::string& password ){
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_PASSWORD) ,
                 password );
         }
@@ -100,26 +110,26 @@
         /**
          * Get the Client Id
          * @return char* to client Id, can be ""
-         */      
-        virtual const char* getClientId(void) const{
-            return getPropertyValue( 
-                CommandConstants::toString( 
+         */
+        virtual const char* getClientId() const{
+            return getPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_CLIENT_ID) );
         }
-      
+
         /**
          * Set the Client Id
          * @param clientId client id string value
          */
         virtual void setClientId( const std::string& clientId ){
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_CLIENT_ID) ,
                 clientId );
         }
 
     protected:
-    
+
         /**
          * Inheritors are required to override this method to init the
          * frame with data appropriate for the command type.
@@ -132,14 +142,14 @@
         }
 
         /**
-         * Inheritors are required to override this method to validate 
+         * Inheritors are required to override this method to validate
          * the passed stomp frame before it is marshalled or unmarshaled
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
         virtual bool validate( const StompFrame& frame ) const
         {
-            if(frame.getCommand() == 
+            if(frame.getCommand() ==
                CommandConstants::toString( CommandConstants::CONNECT ) )
             {
                 return true;
@@ -149,7 +159,7 @@
         }
 
     };
-    
+
 }}}}
 
 #endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_CONNECTCOMMAND_H_*/

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectedCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectedCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectedCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ConnectedCommand.h Thu Apr 12 13:29:39 2007
@@ -35,15 +35,25 @@
     {
     public:
    
-        ConnectedCommand(void) :
+        ConnectedCommand() :
             AbstractCommand< transport::Response >() {
                 initialize( getFrame() );
         }
+
         ConnectedCommand( StompFrame* frame ) : 
             AbstractCommand< transport::Response >( frame ) {
                 validate( getFrame() );
         }
-        virtual ~ConnectedCommand(void) {}
+
+        virtual ~ConnectedCommand() {}
+
+        /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return new ConnectedCommand( getFrame().clone() );
+        }
 
         /**
          * Sets the Correlation Id if this Command

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/DisconnectCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/DisconnectCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/DisconnectCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/DisconnectCommand.h Thu Apr 12 13:29:39 2007
@@ -26,7 +26,7 @@
 namespace connector{
 namespace stomp{
 namespace commands{
-	
+
     /**
      * Sent to the broker to disconnect gracefully before closing
      * the transport.
@@ -35,18 +35,28 @@
     {
     public:
 
-        DisconnectCommand(void) :
+        DisconnectCommand() :
             AbstractCommand<transport::Command>() {
                 initialize( getFrame() );
         }
-        DisconnectCommand( StompFrame* frame ) : 
+
+        DisconnectCommand( StompFrame* frame ) :
             AbstractCommand<transport::Command>( frame ) {
                 validate( getFrame() );
         }
+
         virtual ~DisconnectCommand(void){};
 
+        /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return new DisconnectCommand( getFrame().clone() );
+        }
+
     protected:
-    
+
         /**
          * Inheritors are required to override this method to init the
          * frame with data appropriate for the command type.
@@ -59,14 +69,14 @@
         }
 
         /**
-         * Inheritors are required to override this method to validate 
+         * Inheritors are required to override this method to validate
          * the passed stomp frame before it is marshalled or unmarshaled
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
         virtual bool validate( const StompFrame& frame ) const
         {
-            if(frame.getCommand() == 
+            if(frame.getCommand() ==
                CommandConstants::toString( CommandConstants::DISCONNECT ) )
             {
                 return true;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ErrorCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ErrorCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ErrorCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ErrorCommand.h Thu Apr 12 13:29:39 2007
@@ -26,7 +26,7 @@
 namespace connector{
 namespace stomp{
 namespace commands{
-    
+
     /**
      * Message sent from the broker when an error
      * occurs.
@@ -39,31 +39,39 @@
             AbstractCommand<transport::Command>() {
                 initialize( getFrame() );
         }
-        
-        ErrorCommand( StompFrame* frame ) : 
+
+        ErrorCommand( StompFrame* frame ) :
             AbstractCommand<transport::Command>( frame ) {
                 validate( getFrame() );
         }
-        
+
         virtual ~ErrorCommand() {};
 
         /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return new ErrorCommand( getFrame().clone() );
+        }
+
+        /**
          * Get the error message
          * @return the error message string
-         */      
+         */
         virtual std::string getErrorMessage() const {
-            return getPropertyValue( 
-                CommandConstants::toString( 
+            return getPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_MESSAGE ), "" );
         }
-      
+
         /**
          * Set the error message
          * @param message the error message string
          */
         virtual void setErrorMessage( const std::string& message ) {
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_MESSAGE),
                 message );
         }
@@ -81,17 +89,17 @@
          * @return Error Message String
          */
         virtual std::string getErrorDetails() const {
-            
+
             const std::vector<unsigned char>& bytes = getBytes();
             if( bytes.size() == 0 ){
                 return "";
             }
-            
+
             return std::string((char*)&getBytes()[0]);
         }
 
     protected:
-    
+
         /**
          * Inheritors are required to override this method to init the
          * frame with data appropriate for the command type.
@@ -104,14 +112,14 @@
         }
 
         /**
-         * Inheritors are required to override this method to validate 
+         * Inheritors are required to override this method to validate
          * the passed stomp frame before it is marshalled or unmarshaled
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
         virtual bool validate( const StompFrame& frame ) const
         {
-            if((frame.getCommand() == 
+            if((frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::ERROR_CMD ) ) &&
                (frame.getProperties().hasProperty(
                     CommandConstants::toString(

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/MessageCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/MessageCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/MessageCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/MessageCommand.h Thu Apr 12 13:29:39 2007
@@ -39,11 +39,21 @@
             StompMessage< cms::Message >() {
                 initialize( getFrame() );
         }
+
         MessageCommand( StompFrame* frame ) :
             StompMessage< cms::Message >( frame ) {
                 validate( getFrame() );
         }
+
         virtual ~MessageCommand() {}
+
+        /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return dynamic_cast<StompCommand*>( this->clone() );
+        }
 
         /**
          * Clone this message exactly, returns a new instance that the

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ReceiptCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ReceiptCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ReceiptCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/ReceiptCommand.h Thu Apr 12 13:29:39 2007
@@ -34,24 +34,34 @@
     class ReceiptCommand : public AbstractCommand< transport::Response >
     {
     public:
-   
-        ReceiptCommand(void) :
+
+        ReceiptCommand() :
             AbstractCommand<transport::Response>() {
                 initialize( getFrame() );
         }
-        ReceiptCommand( StompFrame* frame ) : 
+
+        ReceiptCommand( StompFrame* frame ) :
             AbstractCommand<transport::Response>( frame ) {
                 validate( getFrame() );
         }
+
         virtual ~ReceiptCommand(void) {}
 
         /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return new ReceiptCommand( getFrame().clone() );
+        }
+
+        /**
          * Get the receipt id
          * @returns the message id
-         */      
-        virtual std::string getReceiptId(void) const{
-            return getPropertyValue( 
-                CommandConstants::toString( 
+         */
+        virtual std::string getReceiptId() const{
+            return getPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_RECEIPTID ), "" );
         }
 
@@ -60,14 +70,14 @@
          * @param id the receipt id
          */
         virtual void setReceiptId( const std::string& id ){
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_RECEIPTID ),
                 id );
         }
 
     protected:
-    
+
         /**
          * Inheritors are required to override this method to init the
          * frame with data appropriate for the command type.
@@ -80,17 +90,17 @@
         }
 
         /**
-         * Inheritors are required to override this method to validate 
+         * Inheritors are required to override this method to validate
          * the passed stomp frame before it is marshalled or unmarshaled
          * @param frame Frame to validate
          * @returns true if frame is valid
          */
         virtual bool validate( const StompFrame& frame ) const
         {
-            if((frame.getCommand() == 
+            if((frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::RECEIPT )) &&
                (frame.getProperties().hasProperty(
-                    CommandConstants::toString( 
+                    CommandConstants::toString(
                         CommandConstants::HEADER_RECEIPTID ) ) ) )
             {
                 return true;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/StompCommand.h Thu Apr 12 13:29:39 2007
@@ -30,7 +30,7 @@
     class StompCommand : public marshal::Marshalable
     {
     protected:
-        
+
         /**
          * Inheritors are required to override this method to init the
          * frame with data appropriate for the command type.
@@ -39,7 +39,7 @@
         virtual void initialize( StompFrame& frame ) = 0;
 
         /**
-         * Inheritors are required to override this method to validate 
+         * Inheritors are required to override this method to validate
          * the passed stomp frame before it is marshalled or unmarshaled
          * @param frame Frame to validate
          * @returns true if frame is valid
@@ -48,7 +48,7 @@
 
     public:
 
-    	virtual ~StompCommand(void) {}
+        virtual ~StompCommand() {}
 
         /**
          * Sets the Command Id of this Message
@@ -60,56 +60,62 @@
          * Gets the Command Id of this Message
          * @return Command Id
          */
-        virtual int getCommandId(void) const = 0;
-        
+        virtual int getCommandId() const = 0;
+
         /**
          * Set if this Message requires a Response
          * @param required true if response is required
          */
         virtual void setResponseRequired( const bool required ) = 0;
-        
+
         /**
          * Is a Response required for this Command
          * @return true if a response is required.
          */
-        virtual bool isResponseRequired(void) const = 0;
-        
+        virtual bool isResponseRequired() const = 0;
+
         /**
          * Gets the Correlation Id that is associated with this message
          * @return the Correlation Id
          */
-        virtual int getCorrelationId(void) const = 0;
-        
+        virtual int getCorrelationId() const = 0;
+
         /**
          * Sets the Correlation Id if this Command
          * @param corrId Id
          */
         virtual void setCorrelationId( int corrId ) = 0;
-        
+
         /**
          * Get the Transaction Id of this Command
          * @return the Id of the Transaction
-         */      
-        virtual std::string getTransactionId(void) const = 0;
-      
+         */
+        virtual std::string getTransactionId() const = 0;
+
         /**
          * Set the Transaction Id of this Command
          * @param id the Id of the Transaction
          */
         virtual void setTransactionId( const std::string& id ) = 0;
-        
+
         /**
          * Retrieve the Stomp Command Id for this message.
          * @return Stomp CommandId enum
          */
-        virtual CommandConstants::CommandId getStompCommandId(void) const = 0;
-        
+        virtual CommandConstants::CommandId getStompCommandId() const = 0;
+
         /**
          * Retrieves the Properties that are part of this command
          * @return const reference to a properties object
          */
-        virtual util::Properties& getProperties(void) = 0;
-        virtual const util::Properties& getProperties(void) const = 0;
+        virtual util::Properties& getProperties() = 0;
+        virtual const util::Properties& getProperties() const = 0;
+
+        /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const = 0;
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/SubscribeCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/SubscribeCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/SubscribeCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/SubscribeCommand.h Thu Apr 12 13:29:39 2007
@@ -27,88 +27,98 @@
 namespace connector{
 namespace stomp{
 namespace commands{
-    
+
     /**
      * Command sent to the broker to subscribe to a topic
      * or queue.
      */
     class SubscribeCommand : public AbstractCommand< transport::Command >
-    {      
+    {
     public:
-      
-        SubscribeCommand(void) :
+
+        SubscribeCommand() :
             AbstractCommand<transport::Command>() {
                 initialize( getFrame() );
         }
-        SubscribeCommand( StompFrame* frame ) : 
+
+        SubscribeCommand( StompFrame* frame ) :
             AbstractCommand< transport::Command >( frame ) {
                 validate( getFrame() );
         }
+
         virtual ~SubscribeCommand(void) {}
 
         /**
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return new SubscribeCommand( getFrame().clone() );
+        }
+
+        /**
          * Get the destination
          * @returns the destination Name String
-         */      
-        virtual std::string getDestination(void) const{
-            return getPropertyValue( 
-                CommandConstants::toString( 
+         */
+        virtual std::string getDestination() const{
+            return getPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_DESTINATION ), "" );
         }
-      
+
         /**
          * Set the destination
          * @param destination the destination Name String
          */
         virtual void setDestination( const std::string& destination ){
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_DESTINATION ),
                 destination );
         }
 
-        /** 
+        /**
          * Set the Ack Mode of this Subscription
          * @param mode Ack mode setting.
          */
         virtual void setAckMode( const CommandConstants::AckMode mode ){
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_ACK ),
                 CommandConstants::toString( mode ) );
         }
 
-        /** 
+        /**
          * Get the Ack Mode of this Subscription
          * @return mode setting.
          */
-        virtual CommandConstants::AckMode getAckMode(void) const{
-            return CommandConstants::toAckMode( 
-                getPropertyValue( 
-                    CommandConstants::toString( 
+        virtual CommandConstants::AckMode getAckMode() const{
+            return CommandConstants::toAckMode(
+                getPropertyValue(
+                    CommandConstants::toString(
                         CommandConstants::HEADER_ACK ) ) );
         }
-        
+
         /**
          * Sets the Message Selector that is associated with this
          * subscribe request
          * @param selector Destination selector string
          */
         virtual void setMessageSelector( const std::string& selector ) {
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_SELECTOR ),
                 selector );
-        }        
+        }
 
         /**
          * Gets the Message Selector that is associated with this
          * subscribe request
          * @returns the selector string
-         */      
-        virtual std::string getMessageSelector(void) const{
-            return getPropertyValue( 
-                CommandConstants::toString( 
+         */
+        virtual std::string getMessageSelector() const{
+            return getPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_SELECTOR ), "" );
         }
 
@@ -118,91 +128,91 @@
          * @param name Subscription Name
          */
         virtual void setSubscriptionName( const std::string& name ) {
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_SUBSCRIPTIONNAME ),
                 name );
-        }        
+        }
 
         /**
          * Gets the Subscription Name that is associated with this
          * subscribe request
          * @returns the Subscription Name
-         */      
-        virtual std::string getSubscriptionName(void) const{
-            return getPropertyValue( 
-                CommandConstants::toString( 
+         */
+        virtual std::string getSubscriptionName() const{
+            return getPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_SUBSCRIPTIONNAME ), "" );
         }
 
         /**
-         * Gets whether or not locally sent messages should be ignored for 
+         * Gets whether or not locally sent messages should be ignored for
          * subscriptions. Set to true to filter out locally sent messages
          * @return NoLocal value
          */
         virtual bool getNoLocal(void) const {
-            return util::Boolean::parseBoolean( getPropertyValue( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_NOLOCAL ), 
+            return util::Boolean::parseBoolean( getPropertyValue(
+                CommandConstants::toString(
+                    CommandConstants::HEADER_NOLOCAL ),
                 "false" ) );
         }
-      
+
         /**
-         * Sets whether or not locally sent messages should be ignored for 
+         * Sets whether or not locally sent messages should be ignored for
          * subscriptions. Set to true to filter out locally sent messages
          * @param noLocal No Local delivery value
          */
         virtual void setNoLocal( bool noLocal ) {
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_NOLOCAL ),
                 util::Boolean::toString( noLocal ) );
         }
 
         /**
-         * Sets whether or not the broker is to dispatch messages in an 
+         * Sets whether or not the broker is to dispatch messages in an
          * asynchronous manner. Set to true if you want Async.
          * @return true if in dispatch async mode
          */
-        virtual bool getDispatchAsync(void) const {
-            return util::Boolean::parseBoolean( getPropertyValue( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_DISPATCH_ASYNC ), 
+        virtual bool getDispatchAsync() const {
+            return util::Boolean::parseBoolean( getPropertyValue(
+                CommandConstants::toString(
+                    CommandConstants::HEADER_DISPATCH_ASYNC ),
                 "false" ) );
         }
-      
+
         /**
-         * Sets whether or not the broker is to dispatch messages in an 
+         * Sets whether or not the broker is to dispatch messages in an
          * asynchronous manner. Set to true if you want Async.
          * @param dispatchAsync true for async dispatch mode
          */
         virtual void setDispatchAsync( bool dispatchAsync ) {
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_DISPATCH_ASYNC ),
                 util::Boolean::toString( dispatchAsync ) );
         }
-        
+
         /**
          * Gets whether or not this consumer is an exclusive consumer for
          * this destination.
          * @return true for exclusive mode
          */
-        virtual bool getExclusive(void) const {
-            return util::Boolean::parseBoolean( getPropertyValue( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_EXCLUSIVE ), 
+        virtual bool getExclusive() const {
+            return util::Boolean::parseBoolean( getPropertyValue(
+                CommandConstants::toString(
+                    CommandConstants::HEADER_EXCLUSIVE ),
                 "false" ) );
         }
-      
+
         /**
          * Sets whether or not this consumer is an exclusive consumer for
          * this destination.
          * @param exclusive true if in exclusive mode
          */
         virtual void setExclusive( bool exclusive ) {
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_EXCLUSIVE ),
                 util::Boolean::toString( exclusive ) );
         }
@@ -210,113 +220,113 @@
         /**
          * Get the max number of pending messages on a destination
          * For Slow Consumer Handlingon non-durable topics by dropping old
-         * messages - we can set a maximum pending limit which once a slow 
-         * consumer backs up to this high water mark we begin to discard 
+         * messages - we can set a maximum pending limit which once a slow
+         * consumer backs up to this high water mark we begin to discard
          * old messages
          * @return Max value
          */
-        virtual int getMaxPendingMsgLimit(void) const {
-            return util::Integer::parseInt( getPropertyValue( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_MAXPENDINGMSGLIMIT ), 
+        virtual int getMaxPendingMsgLimit() const {
+            return util::Integer::parseInt( getPropertyValue(
+                CommandConstants::toString(
+                    CommandConstants::HEADER_MAXPENDINGMSGLIMIT ),
                 "0" ) );
         }
-      
+
         /**
          * Set the max number of pending messages on a destination
          * For Slow Consumer Handlingon non-durable topics by dropping old
-         * messages - we can set a maximum pending limit which once a slow 
-         * consumer backs up to this high water mark we begin to discard 
+         * messages - we can set a maximum pending limit which once a slow
+         * consumer backs up to this high water mark we begin to discard
          * old messages
          * @param limit Max Pending value
          */
         virtual void setMaxPendingMsgLimit( int limit ) {
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_MAXPENDINGMSGLIMIT ),
                 util::Integer::toString( limit ) );
         }
-        
+
         /**
-         * Get the maximum number of pending messages that will be 
-         * dispatched to the client. Once this maximum is reached no more 
-         * messages are dispatched until the client acknowledges a message. 
+         * Get the maximum number of pending messages that will be
+         * dispatched to the client. Once this maximum is reached no more
+         * messages are dispatched until the client acknowledges a message.
          * Set to 1 for very fair distribution of messages across consumers
          * where processing messages can be slow
          * @return prefetch size value
          */
-        virtual int getPrefetchSize(void) const {
-            return util::Integer::parseInt( getPropertyValue( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_PREFETCHSIZE ), 
+        virtual int getPrefetchSize() const {
+            return util::Integer::parseInt( getPropertyValue(
+                CommandConstants::toString(
+                    CommandConstants::HEADER_PREFETCHSIZE ),
                 "1000" ) );
         }
-      
+
         /**
-         * Set the maximum number of pending messages that will be 
-         * dispatched to the client. Once this maximum is reached no more 
-         * messages are dispatched until the client acknowledges a message. 
+         * Set the maximum number of pending messages that will be
+         * dispatched to the client. Once this maximum is reached no more
+         * messages are dispatched until the client acknowledges a message.
          * Set to 1 for very fair distribution of messages across consumers
          * where processing messages can be slow
          * @param size prefetch size value
          */
         virtual void setPrefetchSize( int size ) {
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_PREFETCHSIZE ),
                 util::Integer::toString( size ) );
         }
 
         /**
-         * Gets the priority of the consumer so that dispatching can be 
+         * Gets the priority of the consumer so that dispatching can be
          * weighted in priority order
          * @return priority level
          */
-        virtual int getPriority(void) const {
-            return util::Integer::parseInt( getPropertyValue( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_CONSUMERPRIORITY ), 
+        virtual int getPriority() const {
+            return util::Integer::parseInt( getPropertyValue(
+                CommandConstants::toString(
+                    CommandConstants::HEADER_CONSUMERPRIORITY ),
                 "0" ) );
         }
-      
+
         /**
-         * Sets the priority of the consumer so that dispatching can be 
+         * Sets the priority of the consumer so that dispatching can be
          * weighted in priority order
          * @param priority message prioirty level
          */
         virtual void setPriority( int priority ) {
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_CONSUMERPRIORITY ),
                 util::Integer::toString( priority ) );
         }
 
         /**
-         * Get For non-durable topics if this subscription is set to be 
+         * Get For non-durable topics if this subscription is set to be
          * retroactive
          * @return true for retroactive mode
          */
-        virtual bool getRetroactive(void) const {
-            return util::Boolean::parseBoolean( getPropertyValue( 
-                CommandConstants::toString( 
-                    CommandConstants::HEADER_RETROACTIVE ), 
+        virtual bool getRetroactive() const {
+            return util::Boolean::parseBoolean( getPropertyValue(
+                CommandConstants::toString(
+                    CommandConstants::HEADER_RETROACTIVE ),
                 "false" ) );
         }
-      
+
         /**
-         * Set For non-durable topics if this subscription is set to be 
+         * Set For non-durable topics if this subscription is set to be
          * retroactive
          * @param retroactive true if in retroactive mode
          */
         virtual void setRetroactive( bool retroactive ) {
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_RETROACTIVE ),
                 util::Boolean::toString( retroactive ) );
         }
-        
+
     protected:
-    
+
         /**
          * Inheritors are required to override this method to init the
          * frame with data appropriate for the command type.
@@ -327,25 +337,25 @@
             frame.setCommand( CommandConstants::toString(
                 CommandConstants::SUBSCRIBE ) );
 
-            setPropertyValue( 
-                CommandConstants::toString( 
+            setPropertyValue(
+                CommandConstants::toString(
                     CommandConstants::HEADER_ACK ),
-                CommandConstants::toString( 
+                CommandConstants::toString(
                     CommandConstants::ACK_AUTO ) );
         }
 
         /**
-         * Inheritors are required to override this method to validate 
+         * Inheritors are required to override this method to validate
          * the passed stomp frame before it is marshalled or unmarshaled
          * @param frame Frame to validate
          * @returns frame true if frame is valid
          */
         virtual bool validate( const StompFrame& frame ) const
         {
-            if((frame.getCommand() == 
+            if((frame.getCommand() ==
                 CommandConstants::toString( CommandConstants::SUBSCRIBE )) &&
                (frame.getProperties().hasProperty(
-                    CommandConstants::toString( 
+                    CommandConstants::toString(
                         CommandConstants::HEADER_DESTINATION ) ) ) )
             {
                 return true;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/TextMessageCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/TextMessageCommand.h?view=diff&rev=528222&r1=528221&r2=528222
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/TextMessageCommand.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/TextMessageCommand.h Thu Apr 12 13:29:39 2007
@@ -45,7 +45,15 @@
         virtual ~TextMessageCommand() {}
 
         /**
-         * Clonse this message exactly, returns a new instance that the
+         * Clone the StompCommand and return the new copy.
+         * @returns new copy of this command caller owns it.
+         */
+        virtual StompCommand* cloneStompCommand() const {
+            return dynamic_cast<StompCommand*>( this->clone() );
+        }
+
+        /**
+         * Clone this message exactly, returns a new instance that the
          * caller is required to delete.
          * @return new copy of this message
          */



Mime
View raw message