activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r501253 - /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/
Date Tue, 30 Jan 2007 00:36:24 GMT
Author: tabish
Date: Mon Jan 29 16:36:23 2007
New Revision: 501253

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

Modified:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp?view=diff&rev=501253&r1=501252&r2=501253
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.cpp Mon Jan 29 16:36:23 2007
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 #include <activemq/connector/openwire/commands/ActiveMQBytesMessage.h>
-#include <activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h>
 
 using namespace std;
 using namespace activemq;
@@ -29,6 +28,7 @@
     dataInputStream( &inputStream ),
     dataOutputStream( &outputStream )
 {
+    clearBody();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -48,6 +48,11 @@
     throw( cms::CMSException ) {
 
     try{
+        
+        clearBody();
+        for( size_t i = 0; i < numBytes; ++i ) {
+            getContent().push_back( buffer[i] );
+        }
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -57,6 +62,7 @@
 const unsigned char* ActiveMQBytesMessage::getBodyBytes(void) const {
 
     try{
+        return reinterpret_cast<const unsigned char*>( &( getContent()[0] ) );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -66,6 +72,7 @@
 std::size_t ActiveMQBytesMessage::getBodyLength(void) const {
 
     try{
+        return getContent().size();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -75,6 +82,8 @@
 void ActiveMQBytesMessage::reset() throw ( cms::CMSException ) {
 
     try{
+        readOnly = true;
+        inputStream.setBuffer( getContent() );            
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -84,6 +93,8 @@
 bool ActiveMQBytesMessage::readBoolean() throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.readBoolean();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -93,6 +104,8 @@
 void ActiveMQBytesMessage::writeBoolean( bool value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.writeBoolean( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -102,6 +115,8 @@
 unsigned char ActiveMQBytesMessage::readByte() throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.readByte();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -111,6 +126,8 @@
 void ActiveMQBytesMessage::writeByte( unsigned char value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.writeByte( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -121,6 +138,8 @@
     throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.read( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -130,6 +149,8 @@
 void ActiveMQBytesMessage::writeBytes( const std::vector<unsigned char>& value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.write( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -140,6 +161,8 @@
     throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.read( buffer, 0, length );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -151,6 +174,8 @@
                          std::size_t length ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.write( value, offset, length );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -160,6 +185,8 @@
 char ActiveMQBytesMessage::readChar() throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.readChar();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -169,6 +196,8 @@
 void ActiveMQBytesMessage::writeChar( char value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.writeChar( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -178,6 +207,8 @@
 float ActiveMQBytesMessage::readFloat() throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.readFloat();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -187,6 +218,8 @@
 void ActiveMQBytesMessage::writeFloat( float value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.writeFloat( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -196,6 +229,8 @@
 double ActiveMQBytesMessage::readDouble() throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.readDouble();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -205,6 +240,8 @@
 void ActiveMQBytesMessage::writeDouble( double value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.writeDouble( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -214,6 +251,8 @@
 short ActiveMQBytesMessage::readShort() throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.readShort();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -223,6 +262,8 @@
 void ActiveMQBytesMessage::writeShort( short value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.writeShort( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -232,6 +273,8 @@
 unsigned short ActiveMQBytesMessage::readUnsignedShort() throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.readUnsignedShort();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -241,6 +284,8 @@
 void ActiveMQBytesMessage::writeUnsignedShort( unsigned short value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.writeUnsignedShort( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -250,6 +295,8 @@
 int ActiveMQBytesMessage::readInt() throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.readInt();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -259,6 +306,8 @@
 void ActiveMQBytesMessage::writeInt( int value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.writeInt( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -268,6 +317,8 @@
 long long ActiveMQBytesMessage::readLong() throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.readLong();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -277,6 +328,8 @@
 void ActiveMQBytesMessage::writeLong( long long value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.writeLong( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -286,6 +339,8 @@
 std::string ActiveMQBytesMessage::readString() throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.readString();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -295,6 +350,8 @@
 void ActiveMQBytesMessage::writeString( const std::string& value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.writeBytes( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -304,6 +361,8 @@
 std::string ActiveMQBytesMessage::readUTF() throw ( cms::CMSException ) {
 
     try{
+        checkReadOnly();
+        return dataInputStream.readUTF();
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
@@ -313,6 +372,8 @@
 void ActiveMQBytesMessage::writeUTF( const std::string& value ) throw ( cms::CMSException ) {
 
     try{
+        checkWriteOnly();
+        dataOutputStream.writeUTF( value );
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h?view=diff&rev=501253&r1=501252&r2=501253
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQBytesMessage.h Mon Jan 29 16:36:23 2007
@@ -24,7 +24,6 @@
 #endif
 
 #include <activemq/connector/openwire/commands/ActiveMQMessageBase.h>
-#include <activemq/util/Config.h>
 #include <activemq/io/ByteArrayInputStream.h>
 #include <activemq/io/ByteArrayOutputStream.h>
 #include <activemq/io/DataInputStream.h>
@@ -83,7 +82,22 @@
             return dynamic_cast<cms::BytesMessage*>( 
                 this->cloneDataStructure() );
         }
-      
+
+        /**
+         * Clears out the body of the message.  This does not clear the
+         * headers or properties.
+         */
+        virtual void clearBody(){
+            
+            // Invoke base class's version.
+            ActiveMQMessageBase<cms::BytesMessage>::clearBody();
+            
+            // Set the stream in write only mode.
+            readOnly = false;
+            
+            outputStream.setBuffer( getContent() );
+        }
+
     public:   // CMS BytesMessage
     
         /**
@@ -346,6 +360,30 @@
          */
         virtual void writeUTF( const std::string& value ) throw ( cms::CMSException );
 
+    protected:
+    
+        /**
+         * Throws an exception if not in write-only mode.
+         * @throws CMSException.
+         */
+        void checkWriteOnly() throw (cms::CMSException){
+            if( readOnly ){
+                throw exceptions::IllegalStateException( __FILE__, __LINE__, 
+                    "message is in read-only mode and cannot be written to" );
+            }
+        }
+        
+        /**
+         * Throws an exception if not in read-only mode.
+         * @throws CMSException
+         */
+        void checkReadOnly() throw (cms::CMSException){
+            if( !readOnly ){
+                throw exceptions::IllegalStateException( __FILE__, __LINE__, 
+                    "message is in write-only mode and cannot be read from" );
+            }
+        }
+        
     private:
 
         /**

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp?view=diff&rev=501253&r1=501252&r2=501253
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp Mon Jan 29 16:36:23 2007
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 #include <activemq/connector/openwire/commands/ActiveMQMapMessage.h>
-#include <activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h>
 
 using namespace std;
 using namespace activemq;
@@ -24,7 +23,8 @@
 using namespace activemq::connector::openwire::commands;
 
 ////////////////////////////////////////////////////////////////////////////////
-ActiveMQMapMessage::ActiveMQMapMessage()
+ActiveMQMapMessage::ActiveMQMapMessage() :
+    ActiveMQMessageBase<cms::MapMessage>()
 {
 }
 
@@ -37,19 +37,4 @@
 unsigned char ActiveMQMapMessage::getDataStructureType() const
 {
     return ActiveMQMapMessage::ID_ACTIVEMQMAPMESSAGE; 
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::acknowledge(void) const throw( cms::CMSException ) {
-
-    try{
-        this->getAckHandler()->acknowledgeMessage( this );
-    }
-    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
-    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
-}
-
-////////////////////////////////////////////////////////////////////////////////
-std::string ActiveMQMapMessage::getCMSMessageId(void) const {
-    return marshal::BaseDataStreamMarshaller::toString( this->getMessageId() );
 }

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h?view=diff&rev=501253&r1=501252&r2=501253
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h Mon Jan 29 16:36:23 2007
@@ -23,8 +23,7 @@
 #pragma warning( disable : 4290 )
 #endif
 
-#include <activemq/connector/openwire/commands/ActiveMQMessage.h>
-#include <activemq/util/Config.h>
+#include <activemq/connector/openwire/commands/ActiveMQMessageBase.h>
 #include <cms/MapMessage.h>
 #include <vector>
 #include <string>
@@ -34,8 +33,8 @@
 namespace openwire{
 namespace commands{
 
-    class ActiveMQMapMessage : public ActiveMQMessage,
-                               public cms::MapMessage
+    class ActiveMQMapMessage : 
+        public ActiveMQMessageBase<cms::MapMessage>
     {
     public:
 
@@ -65,7 +64,7 @@
          * @return src - Source Object
          */
         virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQMessage::copyDataStructure( src );
+            ActiveMQMessageBase<cms::MapMessage>::copyDataStructure( src );
         }
         
     public:   // CMS Message
@@ -75,337 +74,11 @@
          * caller is required to delete.
          * @return new copy of this message
          */
-        virtual cms::Message* clone(void) const {
-            return dynamic_cast<cms::Message*>( 
+        virtual cms::MapMessage* clone(void) const {
+            return dynamic_cast<cms::MapMessage*>( 
                 this->cloneDataStructure() );
         }
         
-        /**
-         * Acknowledges all consumed messages of the session 
-         * of this consumed message.
-         */
-        virtual void acknowledge(void) const throw( cms::CMSException );
-
-        /**
-         * Clears out the body of the message.  This does not clear the
-         * headers or properties.
-         */
-        virtual void clearBody();
-        
-        /**
-         * Clears the message properties.  Does not clear the body or
-         * header values.
-         */
-        virtual void clearProperties();
-        
-        /**
-         * Retrieves the propery names.
-         * @return The complete set of property names currently in this
-         * message.
-         */
-        virtual std::vector<std::string> getPropertyNames() const ;
-        
-        /**
-         * Indicates whether or not a given property exists.
-         * @param name The name of the property to look up.
-         * @return True if the property exists in this message.
-         */
-        virtual bool propertyExists( const std::string& name ) const;
-        
-        /**
-         * Gets a boolean property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual bool getBooleanProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a byte property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual unsigned char getByteProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a double property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual double getDoubleProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a float property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual float getFloatProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a int property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual int getIntProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a long property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual long long getLongProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a short property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual short getShortProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a string property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual std::string getStringProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-        
-        /**
-         * Sets a boolean property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setBooleanProperty( const std::string& name,
-            bool value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a byte property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setByteProperty( const std::string& name,
-            unsigned char value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a double property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setDoubleProperty( const std::string& name,
-            double value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a float property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setFloatProperty( const std::string& name,
-            float value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a int property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setIntProperty( const std::string& name,
-            int value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a long property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setLongProperty( const std::string& name,
-            long long value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a short property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setShortProperty( const std::string& name,
-            short value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a string property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setStringProperty( const std::string& name,
-            const std::string& value ) throw( cms::CMSException );
-      
-        /**
-         * Get the Correlation Id for this message
-         * @return string representation of the correlation Id
-         */
-        virtual std::string getCMSCorrelationId(void) const {
-            return this->getCorrelationId();
-        }
-
-        /**
-         * Sets the Correlation Id used by this message
-         * @param correlationId - String representing the correlation id.
-         */
-        virtual void setCMSCorrelationId( const std::string& correlationId ) {
-            this->setCorrelationId( correlationId );
-        }
-
-        /**
-         * Gets the DeliveryMode for this message
-         * @return DeliveryMode enumerated value.
-         */
-        virtual int getCMSDeliveryMode(void) const {
-            return this->isPersistent();
-        }
-
-        /**
-         * Sets the DeliveryMode for this message
-         * @param mode - DeliveryMode enumerated value.
-         */
-        virtual void setCMSDeliveryMode( int mode ) {
-            this->setPersistent( mode != 0 );
-        }
-      
-        /**
-         * Gets the Destination for this Message, returns a
-         * @return Destination object
-         */
-        virtual const cms::Destination* getCMSDestination(void) const {
-            return dynamic_cast<const cms::Destination*>(
-                this->getDestination() );
-        }
-      
-        /**
-         * Sets the Destination for this message
-         * @param destination - Destination Object
-         */
-        virtual void setCMSDestination( const cms::Destination* destination AMQCPP_UNUSED ) {
-//            this->setDestination( destination );
-        }
-      
-        /**
-         * Gets the Expiration Time for this Message
-         * @return time value
-         */
-        virtual long long getCMSExpiration(void) const {
-            return this->getExpiration();
-        }
-      
-        /**
-         * Sets the Expiration Time for this message
-         * @param expireTime - time value
-         */
-        virtual void setCMSExpiration( long long expireTime ) {
-            this->setExpiration( expireTime );
-        }
-      
-        /**
-         * Gets the CMS Message Id for this Message
-         * @return time value
-         */
-        virtual std::string getCMSMessageId(void) const;
-      
-        /**
-         * Sets the CMS Message Id for this message
-         * @param id - time value
-         */
-        virtual void setCMSMessageId( const std::string& id AMQCPP_UNUSED ) {}
-      
-        /**
-         * Gets the Priority Value for this Message
-         * @return priority value
-         */
-        virtual int getCMSPriority(void) const {
-            return this->getPriority();
-        }
-      
-        /**
-         * Sets the Priority Value for this message
-         * @param priority - priority value for this message
-         */
-        virtual void setCMSPriority( int priority ) {
-            this->setPriority( priority );
-        }
-
-        /**
-         * Gets the Redelivered Flag for this Message
-         * @return redelivered value
-         */
-        virtual bool getCMSRedelivered(void) const {
-            return this->getRedeliveryCounter() != 0;
-        }
-      
-        /**
-         * Sets the Redelivered Flag for this message
-         * @param redelivered - boolean redelivered value
-         */
-        virtual void setCMSRedelivered( bool redelivered AMQCPP_UNUSED ) {}
-
-        /**
-         * Gets the CMS Reply To Address for this Message
-         * @return Reply To Value
-         */
-        virtual const cms::Destination* getCMSReplyTo(void) const;
-      
-        /**
-         * Sets the CMS Reply To Address for this message
-         * @param id - Reply To value
-         */
-        virtual void setCMSReplyTo( const cms::Destination* destination );
-
-        /**
-         * Gets the Time Stamp for this Message
-         * @return time stamp value
-         */
-        virtual long long getCMSTimeStamp(void) const {
-            return this->getTimestamp();
-        }
-      
-        /**
-         * Sets the Time Stamp for this message
-         * @param timeStamp - integer time stamp value
-         */
-        virtual void setCMSTimeStamp( long long timeStamp ) {
-            this->setTimestamp( timeStamp );
-        }
-
-        /**
-         * Gets the CMS Message Type for this Message
-         * @return type value
-         */
-        virtual std::string getCMSMessageType(void) const {
-            return this->getType();
-        }
-      
-        /**
-         * Sets the CMS Message Type for this message
-         * @param type - message type value string
-         */
-        virtual void setCMSMessageType( const std::string& type ) {
-            this->setType( type );
-        }
     public:   // CMS MapMessage
     
         /**
@@ -578,22 +251,6 @@
          */
         virtual void setString( const std::string& name, 
                                 const std::string& value );
-
-    public:  // ActiveMQMessage
-
-        /**
-         * Returns if this message has expired, meaning that its
-         * Expiration time has elapsed.
-         * @returns true if message is expired.
-         */
-        virtual bool isExpired() const {
-            long long expireTime = this->getCMSExpiration();
-            long long currentTime = util::Date::getCurrentTimeMilliseconds();
-            if( expireTime > 0 && currentTime > expireTime ) {
-                return true;
-            }
-            return false;
-        }
 
     };
 

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp?view=diff&rev=501253&r1=501252&r2=501253
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.cpp Mon Jan 29 16:36:23 2007
@@ -15,9 +15,6 @@
  * limitations under the License.
  */
 #include <activemq/connector/openwire/commands/ActiveMQMessage.h>
-#include <activemq/connector/openwire/OpenWireFormat.h>
-#include <activemq/util/Config.h>
-#include <activemq/connector/openwire/marshal/PrimitiveMapMarshaller.h>
 
 using namespace std;
 using namespace activemq;
@@ -28,7 +25,8 @@
 using namespace activemq::connector::openwire::marshal;
 
 ////////////////////////////////////////////////////////////////////////////////
-ActiveMQMessage::ActiveMQMessage()
+ActiveMQMessage::ActiveMQMessage() : 
+    ActiveMQMessageBase<cms::Message>()
 {}
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -38,15 +36,4 @@
 ////////////////////////////////////////////////////////////////////////////////
 unsigned char ActiveMQMessage::getDataStructureType() const {
     return ActiveMQMessage::ID_ACTIVEMQMESSAGE; 
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMessage::beforeMarshall( OpenWireFormat* wireFormat AMQCPP_UNUSED )
-{
-    marshalledProperties.clear();
-    if( !properties.isEmpty() )
-    {
-        PrimitiveMapMarshaller::marshal( 
-            &properties, marshalledProperties );
-    }
 }

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h?view=diff&rev=501253&r1=501252&r2=501253
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMessage.h Mon Jan 29 16:36:23 2007
@@ -18,12 +18,7 @@
 #ifndef _ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQMESSAGE_H_
 #define _ACTIVEMQ_CONNECTOR_OPENWIRE_COMMANDS_ACTIVEMQMESSAGE_H_
 
-#include <activemq/connector/openwire/commands/Message.h>
-#include <activemq/core/ActiveMQMessage.h>
-#include <activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h>
-#include <activemq/core/ActiveMQAckHandler.h>
-#include <activemq/util/Date.h>
-#include <activemq/util/PrimitiveMap.h>
+#include <activemq/connector/openwire/commands/ActiveMQMessageBase.h>
 
 namespace activemq{
 namespace connector{
@@ -31,8 +26,7 @@
 namespace commands{
 
     class ActiveMQMessage : 
-        public Message, 
-        public core::ActiveMQMessage
+        public ActiveMQMessageBase<cms::Message>
     {
     public:
 
@@ -54,75 +48,18 @@
             ActiveMQMessage::copyDataStructure( src );
         }
 
-        /**
-         * Indicates that this command is aware of Marshalling, and needs
-         * to have its Marshalling methods invoked.
-         * @returns boolean indicating desire to be in marshalling stages
-         */
-        virtual bool IsMarshallAware() {
-            return true;
-        }
-        
-        /**
-         * Handles the marshalling of the objects properties into the 
-         * internal byte array before the object is marshalled to the
-         * wire
-         * @param wireFormat - the wireformatting controller
-         */
-        virtual void beforeMarshall( OpenWireFormat* wireFormat );
-
-    public:   // core::ActiveMQMessage
+    public:  // cms::Message
     
         /**
-         * Sets the Acknowledgement Handler that this Message will use
-         * when the Acknowledge method is called.
-         * @param handler ActiveMQAckHandler to call
-         */
-        virtual void setAckHandler( core::ActiveMQAckHandler* handler ) {
-            this->ackHandler = handler;
-        }
-        
-        /**
-         * Gets the Acknowledgement Handler that this Message will use
-         * when the Acknowledge method is called.
-         * @returns handler ActiveMQAckHandler to call or NULL if not set
-         */
-        virtual core::ActiveMQAckHandler* getAckHandler() const {
-            return this->ackHandler;
+         * Clonse this message exactly, returns a new instance that the
+         * caller is required to delete.
+         * @return new copy of this message
+         */
+        virtual cms::Message* clone(void) const {
+            return dynamic_cast<cms::Message*>( 
+                this->cloneDataStructure() );
         }
-
-        /**
-         * Gets the number of times this message has been redelivered.
-         * @return redelivery count
-         */
-        virtual int getRedeliveryCount(void) const {
-            return redeliveryCount;
-        }
-        
-        /**
-         * Sets the count of the number of times this message has been 
-         * redelivered
-         * @param count the redelivery count
-         */
-        virtual void setRedeliveryCount( int count ) {
-            this->redeliveryCount = count;
-        }
-
-        /**
-         * Returns if this message has expired, meaning that its
-         * Expiration time has elapsed.
-         * @returns true if message is expired.
-         */
-        virtual bool isExpired() const {
-            return false;
-        }
-      
-    private:
-   
-        core::ActiveMQAckHandler* ackHandler;
-        int redeliveryCount;
-        util::PrimitiveMap properties;
-
+    
     };
 
 }}}}

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.cpp?view=diff&rev=501253&r1=501252&r2=501253
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.cpp Mon Jan 29 16:36:23 2007
@@ -23,7 +23,8 @@
 using namespace activemq::connector::openwire::commands;
 
 ////////////////////////////////////////////////////////////////////////////////
-ActiveMQObjectMessage::ActiveMQObjectMessage()
+ActiveMQObjectMessage::ActiveMQObjectMessage() :
+    ActiveMQMessageBase<cms::ObjectMessage>()
 {
 }
 

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h?view=diff&rev=501253&r1=501252&r2=501253
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQObjectMessage.h Mon Jan 29 16:36:23 2007
@@ -23,20 +23,17 @@
 #pragma warning( disable : 4290 )
 #endif
 
-#include <activemq/connector/openwire/commands/ActiveMQMessage.h>
-#include <vector>
-#include <string>
+#include <activemq/connector/openwire/commands/ActiveMQMessageBase.h>
+#include <cms/ObjectMessage.h>
 
 namespace activemq{
 namespace connector{
 namespace openwire{
 namespace commands{
 
-    class ActiveMQObjectMessage : public ActiveMQMessage
+    class ActiveMQObjectMessage : 
+        public ActiveMQMessageBase<cms::ObjectMessage>
     {
-    protected:
-
-
     public:
 
         const static unsigned char ID_ACTIVEMQOBJECTMESSAGE = 26;
@@ -65,21 +62,21 @@
          * @return src - Source Object
          */
         virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQMessage::copyDataStructure( src );
+            ActiveMQMessageBase<cms::ObjectMessage>::copyDataStructure( src );
         }
-
-
-    public:  // ActiveMQMessage
-
+        
+    public:  // cms::Message
+    
         /**
-         * Returns if this message has expired, meaning that its
-         * Expiration time has elapsed.
-         * @returns true if message is expired.
+         * Clonse this message exactly, returns a new instance that the
+         * caller is required to delete.
+         * @return new copy of this message
          */
-        virtual bool isExpired() const {
-            return false;
+        virtual cms::Message* clone(void) const {
+            return dynamic_cast<cms::Message*>( 
+                this->cloneDataStructure() );
         }
-        
+
     };
 
 }}}}

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.cpp?view=diff&rev=501253&r1=501252&r2=501253
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.cpp (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.cpp Mon Jan 29 16:36:23 2007
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 #include <activemq/connector/openwire/commands/ActiveMQTextMessage.h>
-#include <activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h>
 
 using namespace std;
 using namespace activemq;
@@ -24,7 +23,8 @@
 using namespace activemq::connector::openwire::commands;
 
 ////////////////////////////////////////////////////////////////////////////////
-ActiveMQTextMessage::ActiveMQTextMessage()
+ActiveMQTextMessage::ActiveMQTextMessage() :
+    ActiveMQMessageBase<cms::TextMessage>()
 {
 }
 
@@ -40,17 +40,34 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ActiveMQTextMessage::acknowledge(void) const throw( cms::CMSException ) {
+std::string ActiveMQTextMessage::getText() const throw( cms::CMSException ) {
 
     try{
-        this->getAckHandler()->acknowledgeMessage( this );
+        return std::string( getContent()[0], getContent().size() ); 
     }
     AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
     AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }
 
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQTextMessage::setText( const char* msg ) throw( cms::CMSException ) {
+    try{
+        int length = strlen( msg );
+        for( int i = 0; i < length; ++i ){
+            getContent().push_back( msg[i] );
+        }
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
+}
 
 ////////////////////////////////////////////////////////////////////////////////
-std::string ActiveMQTextMessage::getCMSMessageId(void) const {
-    return marshal::BaseDataStreamMarshaller::toString( this->getMessageId() );
+void ActiveMQTextMessage::setText( const std::string& msg ) throw( cms::CMSException ) {
+    try{
+        for( size_t i = 0; i < msg.length(); ++i ){
+            getContent().push_back( msg[i] );
+        }
+    }
+    AMQ_CATCH_RETHROW( exceptions::ActiveMQException )
+    AMQ_CATCHALL_THROW( exceptions::ActiveMQException )
 }

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h?view=diff&rev=501253&r1=501252&r2=501253
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h (original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQTextMessage.h Mon Jan 29 16:36:23 2007
@@ -23,8 +23,7 @@
 #pragma warning( disable : 4290 )
 #endif
 
-#include <activemq/connector/openwire/commands/ActiveMQMessage.h>
-#include <activemq/util/Config.h>
+#include <activemq/connector/openwire/commands/ActiveMQMessageBase.h>
 #include <cms/TextMessage.h>
 #include <vector>
 #include <string>
@@ -34,8 +33,8 @@
 namespace openwire{
 namespace commands{
 
-    class ActiveMQTextMessage : public ActiveMQMessage,
-                                public cms::TextMessage
+    class ActiveMQTextMessage : 
+        public ActiveMQMessageBase<cms::TextMessage>
     {
     public:
 
@@ -65,7 +64,7 @@
          * @return src - Source Object
          */
         virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQMessage::copyDataStructure( src );
+            ActiveMQMessageBase<cms::TextMessage>::copyDataStructure( src );
         }
 
     public:   // CMS Message
@@ -80,335 +79,7 @@
                 this->cloneDataStructure() );
         }
         
-        /**
-         * Acknowledges all consumed messages of the session 
-         * of this consumed message.
-         */
-        virtual void acknowledge(void) const throw( cms::CMSException );
-
-        /**
-         * Clears out the body of the message.  This does not clear the
-         * headers or properties.
-         */
-        virtual void clearBody();
-        
-        /**
-         * Clears the message properties.  Does not clear the body or
-         * header values.
-         */
-        virtual void clearProperties();
-        
-        /**
-         * Retrieves the propery names.
-         * @return The complete set of property names currently in this
-         * message.
-         */
-        virtual std::vector<std::string> getPropertyNames() const ;
-        
-        /**
-         * Indicates whether or not a given property exists.
-         * @param name The name of the property to look up.
-         * @return True if the property exists in this message.
-         */
-        virtual bool propertyExists( const std::string& name ) const;
-        
-        /**
-         * Gets a boolean property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual bool getBooleanProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a byte property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual unsigned char getByteProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a double property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual double getDoubleProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a float property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual float getFloatProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a int property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual int getIntProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a long property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual long long getLongProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a short property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual short getShortProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-            
-        /**
-         * Gets a string property.
-         * @param name The name of the property to retrieve.
-         * @return The value for the named property.
-         * @throws CMSException if the property does not exist.
-         */
-        virtual std::string getStringProperty( const std::string& name ) const 
-            throw( cms::CMSException );
-        
-        /**
-         * Sets a boolean property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setBooleanProperty( const std::string& name,
-            bool value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a byte property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setByteProperty( const std::string& name,
-            unsigned char value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a double property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setDoubleProperty( const std::string& name,
-            double value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a float property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setFloatProperty( const std::string& name,
-            float value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a int property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setIntProperty( const std::string& name,
-            int value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a long property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setLongProperty( const std::string& name,
-            long long value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a short property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setShortProperty( const std::string& name,
-            short value ) throw( cms::CMSException );
-            
-        /**
-         * Sets a string property.
-         * @param name The name of the property to retrieve.
-         * @param value The value for the named property.
-         * @throws CMSException
-         */
-        virtual void setStringProperty( const std::string& name,
-            const std::string& value ) throw( cms::CMSException );
-      
-        /**
-         * Get the Correlation Id for this message
-         * @return string representation of the correlation Id
-         */
-        virtual std::string getCMSCorrelationId(void) const {
-            return this->getCorrelationId();
-        }
-
-        /**
-         * Sets the Correlation Id used by this message
-         * @param correlationId - String representing the correlation id.
-         */
-        virtual void setCMSCorrelationId( const std::string& correlationId ) {
-            this->setCorrelationId( correlationId );
-        }
-
-        /**
-         * Gets the DeliveryMode for this message
-         * @return DeliveryMode enumerated value.
-         */
-        virtual int getCMSDeliveryMode(void) const {
-            return this->isPersistent();
-        }
-
-        /**
-         * Sets the DeliveryMode for this message
-         * @param mode - DeliveryMode enumerated value.
-         */
-        virtual void setCMSDeliveryMode( int mode ) {
-            this->setPersistent( mode != 0 );
-        }
-      
-        /**
-         * Gets the Destination for this Message, returns a
-         * @return Destination object
-         */
-        virtual const cms::Destination* getCMSDestination(void) const {
-            return dynamic_cast<const cms::Destination*>(
-                this->getDestination() );
-        }
-      
-        /**
-         * Sets the Destination for this message
-         * @param destination - Destination Object
-         */
-        virtual void setCMSDestination( const cms::Destination* destination AMQCPP_UNUSED ) {
-//            this->setDestination( 
-//                dynamic_cast<const ActiveMQDestination*>( destination ) );
-        }
-      
-        /**
-         * Gets the Expiration Time for this Message
-         * @return time value
-         */
-        virtual long long getCMSExpiration(void) const {
-            return this->getExpiration();
-        }
-      
-        /**
-         * Sets the Expiration Time for this message
-         * @param expireTime - time value
-         */
-        virtual void setCMSExpiration( long long expireTime ) {
-            this->setExpiration( expireTime );
-        }
-      
-        /**
-         * Gets the CMS Message Id for this Message
-         * @return time value
-         */
-        virtual std::string getCMSMessageId(void) const;
-      
-        /**
-         * Sets the CMS Message Id for this message
-         * @param id - time value
-         */
-        virtual void setCMSMessageId( const std::string& id AMQCPP_UNUSED ) {}
-      
-        /**
-         * Gets the Priority Value for this Message
-         * @return priority value
-         */
-        virtual int getCMSPriority(void) const {
-            return this->getPriority();
-        }
-      
-        /**
-         * Sets the Priority Value for this message
-         * @param priority - priority value for this message
-         */
-        virtual void setCMSPriority( int priority ) {
-            this->setPriority( priority );
-        }
-
-        /**
-         * Gets the Redelivered Flag for this Message
-         * @return redelivered value
-         */
-        virtual bool getCMSRedelivered(void) const {
-            return this->getRedeliveryCounter() != 0;
-        }
-      
-        /**
-         * Sets the Redelivered Flag for this message
-         * @param redelivered - boolean redelivered value
-         */
-        virtual void setCMSRedelivered( bool redelivered AMQCPP_UNUSED ) {}
-
-        /**
-         * Gets the CMS Reply To Address for this Message
-         * @return Reply To Value
-         */
-        virtual const cms::Destination* getCMSReplyTo(void) const;
-      
-        /**
-         * Sets the CMS Reply To Address for this message
-         * @param id - Reply To value
-         */
-        virtual void setCMSReplyTo( const cms::Destination* destination );
-
-        /**
-         * Gets the Time Stamp for this Message
-         * @return time stamp value
-         */
-        virtual long long getCMSTimeStamp(void) const {
-            return this->getTimestamp();
-        }
-      
-        /**
-         * Sets the Time Stamp for this message
-         * @param timeStamp - integer time stamp value
-         */
-        virtual void setCMSTimeStamp( long long timeStamp ) {
-            this->setTimestamp( timeStamp );
-        }
-
-        /**
-         * Gets the CMS Message Type for this Message
-         * @return type value
-         */
-        virtual std::string getCMSMessageType(void) const {
-            return this->getType();
-        }
-      
-        /**
-         * Sets the CMS Message Type for this message
-         * @param type - message type value string
-         */
-        virtual void setCMSMessageType( const std::string& type ) {
-            this->setType( type );
-        }
-        
-    public:   // CMS TextMessage
+    public:   // cms::TextMessage
     
         /**
          * Gets the message character buffer.
@@ -428,22 +99,6 @@
          * @param msg The message buffer.
          */
         virtual void setText( const std::string& msg ) throw( cms::CMSException );
-
-    public:  // ActiveMQMessage
-
-        /**
-         * Returns if this message has expired, meaning that its
-         * Expiration time has elapsed.
-         * @returns true if message is expired.
-         */
-        virtual bool isExpired() const {
-            long long expireTime = this->getCMSExpiration();
-            long long currentTime = util::Date::getCurrentTimeMilliseconds();
-            if( expireTime > 0 && currentTime > expireTime ) {
-                return true;
-            }
-            return false;
-        }
 
     };
 



Mime
View raw message