You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/05/14 20:22:41 UTC

svn commit: r774861 [1/2] - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/ main/activemq/commands/ main/activemq/wireformat/openwire/marshal/ test/ test/activemq/commands/ test/activemq/wireformat/openwire/marshal/

Author: tabish
Date: Thu May 14 18:22:39 2009
New Revision: 774861

URL: http://svn.apache.org/viewvc?rev=774861&view=rev
Log:
All the basic pieces needed for Stream Message, Not tested for transmission but basic unit tests pass.  Code should now remain source and binary compatible if this doesn't get done before 3.1

Added:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp
      - copied, changed from r774073, activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h
      - copied, changed from r774073, activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.h   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.cpp
      - copied, changed from r774073, activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.h
      - copied, changed from r774073, activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.h
Removed:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.h
Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp

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?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am Thu May 14 18:22:39 2009
@@ -178,7 +178,7 @@
     activemq/wireformat/openwire/marshal/v1/JournalTraceMarshaller.cpp \
     activemq/wireformat/openwire/marshal/v1/BrokerInfoMarshaller.cpp \
     activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.cpp \
-    activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.cpp \
+    activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp \
     activemq/wireformat/openwire/marshal/v2/BrokerIdMarshaller.cpp \
     activemq/wireformat/openwire/marshal/v2/FlushCommandMarshaller.cpp \
     activemq/wireformat/openwire/marshal/v2/WireFormatInfoMarshaller.cpp \
@@ -719,7 +719,6 @@
     activemq/wireformat/openwire/marshal/v1/ActiveMQTempQueueMarshaller.h \
     activemq/wireformat/openwire/marshal/v1/ResponseMarshaller.h \
     activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.h \
-    activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.h \
     activemq/wireformat/openwire/marshal/v2/NetworkBridgeFilterMarshaller.h \
     activemq/wireformat/openwire/marshal/v2/ActiveMQObjectMessageMarshaller.h \
     activemq/wireformat/openwire/marshal/v2/DataResponseMarshaller.h \
@@ -783,6 +782,7 @@
     activemq/wireformat/openwire/marshal/v2/ActiveMQTempQueueMarshaller.h \
     activemq/wireformat/openwire/marshal/v2/ResponseMarshaller.h \
     activemq/wireformat/openwire/marshal/DataStreamMarshaller.h \
+    activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h \
     activemq/wireformat/openwire/marshal/v3/NetworkBridgeFilterMarshaller.h \
     activemq/wireformat/openwire/marshal/v3/ActiveMQObjectMessageMarshaller.h \
     activemq/wireformat/openwire/marshal/v3/DataResponseMarshaller.h \

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.cpp Thu May 14 18:22:39 2009
@@ -33,3 +33,31 @@
 unsigned char ActiveMQBlobMessage::getDataStructureType() const {
     return ActiveMQBlobMessage::ID_ACTIVEMQBLOBMESSAGE;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQBlobMessage* ActiveMQBlobMessage::cloneDataStructure() const {
+    std::auto_ptr<ActiveMQBlobMessage> message( new ActiveMQBlobMessage() );
+    message->copyDataStructure( this );
+    return message.release();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQBlobMessage::copyDataStructure( const DataStructure* src ) {
+    ActiveMQMessageTemplate<cms::Message>::copyDataStructure( src );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQBlobMessage::toString() const{
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQBlobMessage" << std::endl;
+    stream << ActiveMQMessageTemplate<cms::Message>::toString();
+    stream << "End Class = ActiveMQBlobMessage" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQBlobMessage::equals( const DataStructure* value ) const {
+    return ActiveMQMessageTemplate<cms::Message>::equals( value );
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h Thu May 14 18:22:39 2009
@@ -59,35 +59,21 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual ActiveMQBlobMessage* cloneDataStructure() const {
-            std::auto_ptr<ActiveMQBlobMessage> message( new ActiveMQBlobMessage() );
-            message->copyDataStructure( this );
-            return message.release();
-        }
+        virtual ActiveMQBlobMessage* cloneDataStructure() const;
 
         /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQMessageTemplate<cms::Message>::copyDataStructure( src );
-        }
+        virtual void copyDataStructure( const DataStructure* src );
 
         /**
          * Returns a string containing the information for this DataStructure
          * such as its type and value of its elements.
          * @return formatted string useful for debugging.
          */
-        virtual std::string toString() const{
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQBlobMessage" << std::endl;
-            stream << ActiveMQMessageTemplate<cms::Message>::toString();
-            stream << "End Class = ActiveMQBlobMessage" << std::endl;
-
-            return stream.str();
-        }
+        virtual std::string toString() const;
 
         /**
          * Compares the DataStructure passed in to this one, and returns if
@@ -95,9 +81,7 @@
          * same type, and that each element of the objects are the same.
          * @returns true if DataStructure's are Equal.
          */
-        virtual bool equals( const DataStructure* value ) const {
-            return ActiveMQMessageTemplate<cms::Message>::equals( value );
-        }
+        virtual bool equals( const DataStructure* value ) const;
 
     public:  // cms::Message
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp Thu May 14 18:22:39 2009
@@ -37,6 +37,45 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+ActiveMQBytesMessage* ActiveMQBytesMessage::cloneDataStructure() const {
+    std::auto_ptr<ActiveMQBytesMessage> message( new ActiveMQBytesMessage() );
+    message->copyDataStructure( this );
+    return message.release();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQBytesMessage::copyDataStructure( const DataStructure* src ) {
+    ActiveMQMessageTemplate<cms::BytesMessage>::copyDataStructure( src );
+    this->reset();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQBytesMessage::toString() const{
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQBytesMessage" << std::endl;
+    stream << ActiveMQMessageTemplate<cms::BytesMessage>::toString();
+    stream << "End Class = ActiveMQBytesMessage" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQBytesMessage::equals( const DataStructure* value ) const {
+    return ActiveMQMessageTemplate<cms::BytesMessage>::equals( value );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQBytesMessage::checkWriteOnlyBody() const throw ( cms::CMSException ){
+    if( !this->isReadOnlyBody() ){
+        throw exceptions::ActiveMQException(
+            __FILE__, __LINE__,
+            "message is in read-only mode and "
+            "cannot be written to" ).convertToCMSException();
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void ActiveMQBytesMessage::setBodyBytes( const unsigned char* buffer,
                                          std::size_t numBytes )
     throw( cms::CMSException ) {
@@ -194,9 +233,7 @@
         checkWriteOnlyBody();
         return dataInputStream.readFloat();
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h Thu May 14 18:22:39 2009
@@ -79,36 +79,21 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual ActiveMQBytesMessage* cloneDataStructure() const {
-            std::auto_ptr<ActiveMQBytesMessage> message( new ActiveMQBytesMessage() );
-            message->copyDataStructure( this );
-            return message.release();
-        }
+        virtual ActiveMQBytesMessage* cloneDataStructure() const;
 
         /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQMessageTemplate<cms::BytesMessage>::copyDataStructure( src );
-            this->reset();
-        }
+        virtual void copyDataStructure( const DataStructure* src );
 
         /**
          * Returns a string containing the information for this DataStructure
          * such as its type and value of its elements.
          * @return formatted string useful for debugging.
          */
-        virtual std::string toString() const{
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQBytesMessage" << std::endl;
-            stream << ActiveMQMessageTemplate<cms::BytesMessage>::toString();
-            stream << "End Class = ActiveMQBytesMessage" << std::endl;
-
-            return stream.str();
-        }
+        virtual std::string toString() const;
 
         /**
          * Compares the DataStructure passed in to this one, and returns if
@@ -116,9 +101,7 @@
          * same type, and that each element of the objects are the same.
          * @returns true if DataStructure's are Equal.
          */
-        virtual bool equals( const DataStructure* value ) const {
-            return ActiveMQMessageTemplate<cms::BytesMessage>::equals( value );
-        }
+        virtual bool equals( const DataStructure* value ) const;
 
     public:   // CMS Message
 
@@ -409,14 +392,7 @@
          * Throws an exception if in write-only mode.
          * @throws CMSException.
          */
-        void checkWriteOnlyBody() const throw ( cms::CMSException ){
-            if( !this->isReadOnlyBody() ){
-                throw exceptions::ActiveMQException(
-                    __FILE__, __LINE__,
-                    "message is in read-only mode and "
-                    "cannot be written to" ).convertToCMSException();
-            }
-        }
+        void checkWriteOnlyBody() const throw ( cms::CMSException );
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.cpp Thu May 14 18:22:39 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/ActiveMQMapMessage.h>
-#include <activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.h>
+#include <activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h>
 
 using namespace std;
 using namespace decaf;
@@ -44,6 +44,41 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+ActiveMQMapMessage* ActiveMQMapMessage::cloneDataStructure() const {
+    ActiveMQMapMessage* message = new ActiveMQMapMessage();
+    message->copyDataStructure( this );
+    return message;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQMapMessage::copyDataStructure( const DataStructure* src ) {
+    ActiveMQMessageTemplate<cms::MapMessage>::copyDataStructure( src );
+
+    const ActiveMQMapMessage* srcMap =
+        dynamic_cast< const ActiveMQMapMessage* >( src );
+
+    if( srcMap != NULL && srcMap->map.get() != NULL ) {
+        this->map.reset( new util::PrimitiveMap( *srcMap->map ) );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQMapMessage::toString() const{
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQMapMessage" << std::endl;
+    stream << ActiveMQMessageTemplate<cms::MapMessage>::toString();
+    stream << "End Class = ActiveMQMapMessage" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQMapMessage::equals( const DataStructure* value ) const {
+    return ActiveMQMessageTemplate<cms::MapMessage>::equals( value );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void ActiveMQMapMessage::beforeMarshal( WireFormat* wireFormat )
     throw ( decaf::io::IOException ) {
 
@@ -54,12 +89,14 @@
 
         if( map.get() != NULL && !map->isEmpty() ) {
             // Marshal as Content.
-            PrimitiveMapMarshaller::marshal( map.get(), getContent() );
+            PrimitiveTypesMarshaller::marshal( map.get(), getContent() );
         } else {
             clearBody();
         }
     }
-    AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
+    AMQ_CATCH_RETHROW( decaf::io::IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, decaf::io::IOException )
+    AMQ_CATCHALL_THROW( decaf::io::IOException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -70,7 +107,9 @@
         this->checkMapIsUnmarshalled();
         return *map;
     }
-    AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
+    AMQ_CATCH_RETHROW( NullPointerException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, NullPointerException )
+    AMQ_CATCHALL_THROW( NullPointerException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -82,7 +121,9 @@
         this->checkMapIsUnmarshalled();
         return *map;
     }
-    AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
+    AMQ_CATCH_RETHROW( NullPointerException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, NullPointerException )
+    AMQ_CATCHALL_THROW( NullPointerException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -93,10 +134,10 @@
 
         if( map.get() == NULL ) {
 
-            if( getContent().size() == 0 ){
-                map.reset( new PrimitiveMap() );
-            } else {
-                map.reset( PrimitiveMapMarshaller::unmarshal( getContent() ) );
+            map.reset( new PrimitiveMap() );
+
+            if( getContent().size() != 0 ){
+                PrimitiveTypesMarshaller::unmarshal( map.get(), getContent() );
             }
 
             if( map.get() == NULL ) {
@@ -107,7 +148,9 @@
             }
         }
     }
-    AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
+    AMQ_CATCH_RETHROW( NullPointerException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, NullPointerException )
+    AMQ_CATCHALL_THROW( NullPointerException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h Thu May 14 18:22:39 2009
@@ -68,27 +68,14 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual ActiveMQMapMessage* cloneDataStructure() const {
-            ActiveMQMapMessage* message = new ActiveMQMapMessage();
-            message->copyDataStructure( this );
-            return message;
-        }
+        virtual ActiveMQMapMessage* cloneDataStructure() const;
 
         /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQMessageTemplate<cms::MapMessage>::copyDataStructure( src );
-
-            const ActiveMQMapMessage* srcMap =
-                dynamic_cast< const ActiveMQMapMessage* >( src );
-
-            if( srcMap != NULL && srcMap->map.get() != NULL ) {
-                this->map.reset( new util::PrimitiveMap( *srcMap->map ) );
-            }
-        }
+        virtual void copyDataStructure( const DataStructure* src );
 
         /**
          * Perform any processing needed before an marshal
@@ -102,25 +89,14 @@
          * such as its type and value of its elements.
          * @return formatted string useful for debugging.
          */
-        virtual std::string toString() const{
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQMapMessage" << std::endl;
-            stream << ActiveMQMessageTemplate<cms::MapMessage>::toString();
-            stream << "End Class = ActiveMQMapMessage" << std::endl;
-
-            return stream.str();
-        }
-
+        virtual std::string toString() const;
         /**
          * Compares the DataStructure passed in to this one, and returns if
          * they are equivalent.  Equivalent here means that they are of the
          * same type, and that each element of the objects are the same.
          * @returns true if DataStructure's are Equal.
          */
-        virtual bool equals( const DataStructure* value ) const {
-            return ActiveMQMessageTemplate<cms::MapMessage>::equals( value );
-        }
+        virtual bool equals( const DataStructure* value ) const;
 
     public:   // CMS Message
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.cpp Thu May 14 18:22:39 2009
@@ -30,3 +30,31 @@
 unsigned char ActiveMQMessage::getDataStructureType() const {
     return ActiveMQMessage::ID_ACTIVEMQMESSAGE;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQMessage::copyDataStructure( const DataStructure* src ) {
+    ActiveMQMessageTemplate<cms::Message>::copyDataStructure( src );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQMessage* ActiveMQMessage::cloneDataStructure() const {
+    ActiveMQMessage* message = new ActiveMQMessage();
+    message->copyDataStructure( this );
+    return message;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQMessage::toString() const{
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQMessage" << std::endl;
+    stream << ActiveMQMessageTemplate<cms::Message>::toString();
+    stream << "Begin Class = ActiveMQMessage" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQMessage::equals( const DataStructure* value ) const {
+    return ActiveMQMessageTemplate<cms::Message>::equals( value );
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h Thu May 14 18:22:39 2009
@@ -49,35 +49,21 @@
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQMessageTemplate<cms::Message>::copyDataStructure( src );
-        }
+        virtual void copyDataStructure( const DataStructure* src );
 
         /**
          * Clone this object and return a new instance that the
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual ActiveMQMessage* cloneDataStructure() const {
-            ActiveMQMessage* message = new ActiveMQMessage();
-            message->copyDataStructure( this );
-            return message;
-        }
+        virtual ActiveMQMessage* cloneDataStructure() const;
 
         /**
          * Returns a string containing the information for this DataStructure
          * such as its type and value of its elements.
          * @return formatted string useful for debugging.
          */
-        virtual std::string toString() const{
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQMessage" << std::endl;
-            stream << ActiveMQMessageTemplate<cms::Message>::toString();
-            stream << "Begin Class = ActiveMQMessage" << std::endl;
-
-            return stream.str();
-        }
+        virtual std::string toString() const;
 
         /**
          * Compares the DataStructure passed in to this one, and returns if
@@ -85,9 +71,7 @@
          * same type, and that each element of the objects are the same.
          * @returns true if DataStructure's are Equal.
          */
-        virtual bool equals( const DataStructure* value ) const {
-            return ActiveMQMessageTemplate<cms::Message>::equals( value );
-        }
+        virtual bool equals( const DataStructure* value ) const;
 
     public:  // cms::Message
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.cpp Thu May 14 18:22:39 2009
@@ -29,3 +29,31 @@
 unsigned char ActiveMQObjectMessage::getDataStructureType() const {
     return ActiveMQObjectMessage::ID_ACTIVEMQOBJECTMESSAGE;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQObjectMessage* ActiveMQObjectMessage::cloneDataStructure() const {
+    std::auto_ptr<ActiveMQObjectMessage> message( new ActiveMQObjectMessage() );
+    message->copyDataStructure( this );
+    return message.release();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQObjectMessage::copyDataStructure( const DataStructure* src ) {
+    ActiveMQMessageTemplate<cms::ObjectMessage>::copyDataStructure( src );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQObjectMessage::toString() const{
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQObjectMessage" << std::endl;
+    stream << ActiveMQMessageTemplate<cms::ObjectMessage>::toString();
+    stream << "Begin Class = ActiveMQObjectMessage" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQObjectMessage::equals( const DataStructure* value ) const {
+    return ActiveMQMessageTemplate<cms::ObjectMessage>::equals( value );
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h Thu May 14 18:22:39 2009
@@ -50,35 +50,21 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual ActiveMQObjectMessage* cloneDataStructure() const {
-            std::auto_ptr<ActiveMQObjectMessage> message( new ActiveMQObjectMessage() );
-            message->copyDataStructure( this );
-            return message.release();
-        }
+        virtual ActiveMQObjectMessage* cloneDataStructure() const;
 
         /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQMessageTemplate<cms::ObjectMessage>::copyDataStructure( src );
-        }
+        virtual void copyDataStructure( const DataStructure* src );
 
         /**
          * Returns a string containing the information for this DataStructure
          * such as its type and value of its elements.
          * @return formatted string useful for debugging.
          */
-        virtual std::string toString() const{
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQObjectMessage" << std::endl;
-            stream << ActiveMQMessageTemplate<cms::ObjectMessage>::toString();
-            stream << "Begin Class = ActiveMQObjectMessage" << std::endl;
-
-            return stream.str();
-        }
+        virtual std::string toString() const;
 
         /**
          * Compares the DataStructure passed in to this one, and returns if
@@ -86,9 +72,7 @@
          * same type, and that each element of the objects are the same.
          * @returns true if DataStructure's are Equal.
          */
-        virtual bool equals( const DataStructure* value ) const {
-            return ActiveMQMessageTemplate<cms::ObjectMessage>::equals( value );
-        }
+        virtual bool equals( const DataStructure* value ) const;
 
     public:  // cms::Message
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.cpp Thu May 14 18:22:39 2009
@@ -33,3 +33,31 @@
 unsigned char ActiveMQQueue::getDataStructureType() const {
     return ActiveMQQueue::ID_ACTIVEMQQUEUE;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQQueue* ActiveMQQueue::cloneDataStructure() const {
+    std::auto_ptr<ActiveMQQueue> message( new ActiveMQQueue() );
+    message->copyDataStructure( this );
+    return message.release();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQQueue::copyDataStructure( const DataStructure* src ) {
+    ActiveMQDestination::copyDataStructure( src );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQQueue::toString() const {
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQQueue" << std::endl;
+    stream << ActiveMQDestination::toString();
+    stream << "End Class = ActiveMQQueue" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQQueue::equals( const DataStructure* value ) const {
+    return ActiveMQDestination::equals( value );
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.h Thu May 14 18:22:39 2009
@@ -54,35 +54,21 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual ActiveMQQueue* cloneDataStructure() const {
-            std::auto_ptr<ActiveMQQueue> message( new ActiveMQQueue() );
-            message->copyDataStructure( this );
-            return message.release();
-        }
+        virtual ActiveMQQueue* cloneDataStructure() const;
 
         /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQDestination::copyDataStructure( src );
-        }
+        virtual void copyDataStructure( const DataStructure* src );
 
         /**
          * Returns a string containing the information for this DataStructure
          * such as its type and value of its elements.
          * @return formatted string useful for debugging.
          */
-        virtual std::string toString() const {
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQQueue" << std::endl;
-            stream << ActiveMQDestination::toString();
-            stream << "End Class = ActiveMQQueue" << std::endl;
-
-            return stream.str();
-        }
+        virtual std::string toString() const;
 
         /**
          * Compares the DataStructure passed in to this one, and returns if
@@ -90,9 +76,7 @@
          * same type, and that each element of the objects are the same.
          * @returns true if DataStructure's are Equal.
          */
-        virtual bool equals( const DataStructure* value ) const {
-            return ActiveMQDestination::equals( value );
-        }
+        virtual bool equals( const DataStructure* value ) const;
 
         /**
          * @returns the cms::Destination interface pointer that the

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp Thu May 14 18:22:39 2009
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 #include <activemq/commands/ActiveMQStreamMessage.h>
+#include <activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h>
+
+#include <algorithm>
+
+#include <decaf/lang/Math.h>
 
 using namespace std;
 using namespace activemq;
@@ -25,12 +30,13 @@
 using namespace activemq::wireformat::openwire;
 using namespace activemq::wireformat::openwire::marshal;
 using namespace decaf;
+using namespace decaf::io;
 using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQStreamMessage::ActiveMQStreamMessage() :
-    ActiveMQMessageTemplate< cms::StreamMessage >() {
+    ActiveMQMessageTemplate< cms::StreamMessage >(), currentPos( 0 ) {
 
     this->clearBody();
 }
@@ -45,6 +51,51 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+ActiveMQStreamMessage* ActiveMQStreamMessage::cloneDataStructure() const {
+    std::auto_ptr<ActiveMQStreamMessage> message( new ActiveMQStreamMessage() );
+    message->copyDataStructure( this );
+    return message.release();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQStreamMessage::copyDataStructure( const DataStructure* src ) {
+    ActiveMQMessageTemplate<cms::StreamMessage>::copyDataStructure( src );
+
+    const ActiveMQStreamMessage* srcStream =
+        dynamic_cast< const ActiveMQStreamMessage* >( src );
+
+    if( srcStream != NULL && srcStream->list.get() != NULL ) {
+        this->list.reset( new util::PrimitiveList( *srcStream->list ) );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQStreamMessage::toString() const{
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQStreamMessage" << std::endl;
+    stream << ActiveMQMessageTemplate<cms::StreamMessage>::toString();
+    stream << "End Class = ActiveMQStreamMessage" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQStreamMessage::equals( const DataStructure* value ) const {
+    return ActiveMQMessageTemplate<cms::StreamMessage>::equals( value );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQStreamMessage::checkWriteOnlyBody() const throw ( cms::CMSException ){
+    if( !this->isReadOnlyBody() ){
+        throw exceptions::ActiveMQException(
+            __FILE__, __LINE__,
+            "message is in read-only mode and "
+            "cannot be written to" ).convertToCMSException();
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void ActiveMQStreamMessage::beforeMarshal( WireFormat* wireFormat )
     throw ( decaf::io::IOException ) {
 
@@ -53,14 +104,70 @@
         // Let the base class do its thing.
         ActiveMQMessageTemplate<cms::StreamMessage>::beforeMarshal( wireFormat );
 
-//        if( map != NULL && !map->isEmpty() ) {
-//            // Marshal as Content.
-//            PrimitiveMapMarshaller::marshal( map, getContent() );
-//        } else {
-//            clearBody();
-//        }
+        if( this->list.get() != NULL && !this->list->isEmpty() ) {
+            // Marshal as Content.
+            PrimitiveTypesMarshaller::marshal( this->list.get(), getContent() );
+        } else {
+            clearBody();
+        }
     }
-    AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
+    AMQ_CATCH_RETHROW( IOException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
+    AMQ_CATCHALL_THROW( IOException )
+}
+
+////////////////////////////////////////////////////////////////////////////////
+PrimitiveList& ActiveMQStreamMessage::getList() throw ( NullPointerException ) {
+
+    try{
+
+        this->checkListIsUnmarshalled();
+        return *( this->list );
+    }
+    AMQ_CATCH_RETHROW( NullPointerException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, NullPointerException )
+    AMQ_CATCHALL_THROW( NullPointerException )
+}
+
+////////////////////////////////////////////////////////////////////////////////
+const PrimitiveList& ActiveMQStreamMessage::getList() const
+    throw ( decaf::lang::exceptions::NullPointerException ) {
+
+    try{
+
+        this->checkListIsUnmarshalled();
+        return *( this->list );
+    }
+    AMQ_CATCH_RETHROW( NullPointerException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, NullPointerException )
+    AMQ_CATCHALL_THROW( NullPointerException )
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQStreamMessage::checkListIsUnmarshalled() const
+    throw ( decaf::lang::exceptions::NullPointerException ) {
+
+    try {
+
+        if( this->list.get() == NULL ) {
+
+            this->list.reset( new PrimitiveList() );
+
+            if( getContent().size() != 0 ){
+                PrimitiveTypesMarshaller::unmarshal( this->list.get(), getContent() );
+            }
+
+            if( this->list.get() == NULL ) {
+                throw NullPointerException(
+                    __FILE__, __LINE__,
+                    "ActiveMQStreamMessage::getMap() - All attempts to create a "
+                    "list have failed." );
+            }
+        }
+    }
+    AMQ_CATCH_RETHROW( NullPointerException )
+    AMQ_CATCH_EXCEPTION_CONVERT( Exception, NullPointerException )
+    AMQ_CATCHALL_THROW( NullPointerException )
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -68,6 +175,7 @@
 
     try{
         this->setReadOnlyBody( true );
+        this->currentPos = 0;
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -77,7 +185,7 @@
 
     try{
         checkWriteOnlyBody();
-        return 0;
+        return this->getList().getBool( this->currentPos++ );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -87,6 +195,7 @@
 
     try{
         checkReadOnlyBody();
+        this->getList().add( value );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -96,7 +205,7 @@
 
     try{
         checkWriteOnlyBody();
-        return 0;
+        return this->getList().getByte( this->currentPos++ );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -106,6 +215,7 @@
 
     try{
         checkReadOnlyBody();
+        this->getList().add( value );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -116,16 +226,19 @@
 
     try{
         checkWriteOnlyBody();
-        return 0;
+        value = this->getList().getByteArray( this->currentPos++ );
+        return value.size();
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ActiveMQStreamMessage::writeBytes( const std::vector<unsigned char>& value ) throw ( cms::CMSException ) {
+void ActiveMQStreamMessage::writeBytes( const std::vector<unsigned char>& value )
+    throw ( cms::CMSException ) {
 
     try{
         checkReadOnlyBody();
+        this->getList().add( value );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -135,19 +248,40 @@
     throw ( cms::CMSException ) {
 
     try{
+
+        if( buffer == NULL ) {
+            throw cms::CMSException( "Passed Buffer was NULL", NULL );
+        }
+
         checkWriteOnlyBody();
-        return 0;
+
+        std::vector<unsigned char> temp = this->getList().getByteArray( this->currentPos++ );
+        std::size_t amount = Math::min( (unsigned int)length, (unsigned int)temp.size() );
+
+        for( std::size_t i = 0; i < amount; ++i ) {
+            buffer[i] = temp.at( i );
+        }
+
+        return amount;
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQStreamMessage::writeBytes( const unsigned char* value,
-                                       std::size_t offset,
-                                       std::size_t length ) throw ( cms::CMSException ) {
+                                        std::size_t offset,
+                                        std::size_t length ) throw ( cms::CMSException ) {
 
     try{
+
         checkReadOnlyBody();
+
+        std::vector<unsigned char> temp;
+        for( std::size_t i = offset; i < length; ++i ) {
+            temp.push_back( value[i] );
+        }
+
+        this->getList().add( temp );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -157,7 +291,7 @@
 
     try{
         checkWriteOnlyBody();
-        return 0;
+        return this->getList().getChar( this->currentPos++ );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -167,6 +301,7 @@
 
     try{
         checkReadOnlyBody();
+        this->getList().add( value );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -176,7 +311,7 @@
 
     try{
         checkWriteOnlyBody();
-        return 0;
+        return this->getList().getFloat( this->currentPos++ );
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
     AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
@@ -188,6 +323,7 @@
 
     try{
         checkReadOnlyBody();
+        this->getList().add( value );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -197,7 +333,7 @@
 
     try{
         checkWriteOnlyBody();
-        return 0;
+        return this->getList().getDouble( this->currentPos++ );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -207,6 +343,7 @@
 
     try{
         checkReadOnlyBody();
+        this->getList().add( value );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -216,7 +353,7 @@
 
     try{
         checkWriteOnlyBody();
-        return 0;
+        return this->getList().getShort( this->currentPos++ );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -226,6 +363,7 @@
 
     try{
         checkReadOnlyBody();
+        this->getList().add( value );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -235,7 +373,7 @@
 
     try{
         checkWriteOnlyBody();
-        return 0;
+        return (unsigned short)this->getList().getShort( this->currentPos++ );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -245,6 +383,7 @@
 
     try{
         checkReadOnlyBody();
+        this->getList().add( (short)value );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -254,7 +393,7 @@
 
     try{
         checkWriteOnlyBody();
-        return 0;
+        return this->getList().getInt( this->currentPos++ );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -264,6 +403,7 @@
 
     try{
         checkReadOnlyBody();
+        this->getList().add( value );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -273,7 +413,7 @@
 
     try{
         checkWriteOnlyBody();
-        return 0;
+        return this->getList().getLong( this->currentPos++ );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -283,6 +423,7 @@
 
     try{
         checkReadOnlyBody();
+        this->getList().add( value );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -292,7 +433,7 @@
 
     try{
         checkWriteOnlyBody();
-        return "";
+        return this->getList().getString( this->currentPos++ );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -302,6 +443,7 @@
 
     try{
         checkReadOnlyBody();
+        this->getList().add( value );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h Thu May 14 18:22:39 2009
@@ -24,6 +24,7 @@
 #endif
 
 #include <activemq/util/Config.h>
+#include <activemq/util/PrimitiveList.h>
 #include <activemq/commands/ActiveMQMessage.h>
 #include <activemq/commands/ActiveMQMessageTemplate.h>
 #include <cms/StreamMessage.h>
@@ -31,6 +32,7 @@
 #include <cms/MessageNotReadableException.h>
 #include <cms/MessageFormatException.h>
 #include <cms/MessageEOFException.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
 #include <string>
 #include <memory>
 
@@ -39,6 +41,15 @@
 
     class AMQCPP_API ActiveMQStreamMessage :
         public ActiveMQMessageTemplate< cms::StreamMessage > {
+    private:
+
+        // Map Structure to hold unmarshaled Map Data
+        mutable std::auto_ptr<util::PrimitiveList> list;
+
+        // When Message is readable this is the index of the next
+        // element to be read.
+        mutable std::size_t currentPos;
+
     public:
 
         const static unsigned char ID_ACTIVEMQSTREAMMESSAGE = 27;
@@ -55,36 +66,21 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual ActiveMQStreamMessage* cloneDataStructure() const {
-            std::auto_ptr<ActiveMQStreamMessage> message( new ActiveMQStreamMessage() );
-            message->copyDataStructure( this );
-            return message.release();
-        }
+        virtual ActiveMQStreamMessage* cloneDataStructure() const;
 
         /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQMessageTemplate<cms::StreamMessage>::copyDataStructure( src );
-            this->reset();
-        }
+        virtual void copyDataStructure( const DataStructure* src );
 
         /**
          * Returns a string containing the information for this DataStructure
          * such as its type and value of its elements.
          * @return formatted string useful for debugging.
          */
-        virtual std::string toString() const{
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQStreamMessage" << std::endl;
-            stream << ActiveMQMessageTemplate<cms::StreamMessage>::toString();
-            stream << "End Class = ActiveMQStreamMessage" << std::endl;
-
-            return stream.str();
-        }
+        virtual std::string toString() const;
 
         /**
          * Compares the DataStructure passed in to this one, and returns if
@@ -92,9 +88,7 @@
          * same type, and that each element of the objects are the same.
          * @returns true if DataStructure's are Equal.
          */
-        virtual bool equals( const DataStructure* value ) const {
-            return ActiveMQMessageTemplate<cms::StreamMessage>::equals( value );
-        }
+        virtual bool equals( const DataStructure* value ) const;
 
         /**
          * Determine if this object is aware of marshaling and should have
@@ -361,14 +355,23 @@
          * Throws an exception if in write-only mode.
          * @throws CMSException.
          */
-        void checkWriteOnlyBody() const throw ( cms::CMSException ){
-            if( !this->isReadOnlyBody() ){
-                throw exceptions::ActiveMQException(
-                    __FILE__, __LINE__,
-                    "message is in read-only mode and "
-                    "cannot be written to" ).convertToCMSException();
-            }
-        }
+        void checkWriteOnlyBody() const throw( cms::CMSException );
+
+        /**
+         * Fetches a reference to this objects PrimitiveList, if one needs
+         * to be created or unmarshaled, this will perform the correct steps.
+         * @returns reference to a PrimtiveList.
+         */
+        util::PrimitiveList& getList()
+            throw ( decaf::lang::exceptions::NullPointerException );
+        const util::PrimitiveList& getList() const
+            throw ( decaf::lang::exceptions::NullPointerException );
+
+        /**
+         * Performs the unmarshal on the List if needed, otherwise just returns.
+         */
+        void checkListIsUnmarshalled() const
+            throw ( decaf::lang::exceptions::NullPointerException );
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.cpp Thu May 14 18:22:39 2009
@@ -44,6 +44,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQTempDestination::toString() const {
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQTempDestination" << std::endl;
+    stream << ActiveMQDestination::toString();
+    stream << "End Class = ActiveMQTempDestination" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void ActiveMQTempDestination::close() throw( cms::CMSException ) {
     try {
         if( this->connection != NULL ) {

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.h Thu May 14 18:22:39 2009
@@ -81,15 +81,7 @@
          * such as its type and value of its elements.
          * @return formatted string useful for debugging.
          */
-        virtual std::string toString() const {
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQTempDestination" << std::endl;
-            stream << ActiveMQDestination::toString();
-            stream << "End Class = ActiveMQTempDestination" << std::endl;
-
-            return stream.str();
-        }
+        virtual std::string toString() const;
 
         /**
          * Compares the DataStructure passed in to this one, and returns if

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.cpp Thu May 14 18:22:39 2009
@@ -43,3 +43,31 @@
 unsigned char ActiveMQTempQueue::getDataStructureType() const {
     return ActiveMQTempQueue::ID_ACTIVEMQTEMPQUEUE;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTempQueue* ActiveMQTempQueue::cloneDataStructure() const {
+    std::auto_ptr<ActiveMQTempQueue> message( new ActiveMQTempQueue() );
+    message->copyDataStructure( this );
+    return message.release();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQTempQueue::copyDataStructure( const DataStructure* src ) {
+    ActiveMQTempDestination::copyDataStructure( src );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQTempQueue::toString() const {
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQTempQueue" << std::endl;
+    stream << ActiveMQTempDestination::toString();
+    stream << "End Class = ActiveMQTempQueue" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQTempQueue::equals( const DataStructure* value ) const {
+    return ActiveMQDestination::equals( value );
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.h Thu May 14 18:22:39 2009
@@ -52,34 +52,20 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual ActiveMQTempQueue* cloneDataStructure() const {
-            std::auto_ptr<ActiveMQTempQueue> message( new ActiveMQTempQueue() );
-            message->copyDataStructure( this );
-            return message.release();
-        }
+        virtual ActiveMQTempQueue* cloneDataStructure() const;
 
         /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQTempDestination::copyDataStructure( src );
-        }
+        virtual void copyDataStructure( const DataStructure* src );
 
         /**
          * Converts the Destination Name into a String
          * @return string name
          */
-        virtual std::string toString() const {
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQTempQueue" << std::endl;
-            stream << ActiveMQTempDestination::toString();
-            stream << "End Class = ActiveMQTempQueue" << std::endl;
-
-            return stream.str();
-        }
+        virtual std::string toString() const;
 
         /**
          * Compares the DataStructure passed in to this one, and returns if
@@ -87,9 +73,7 @@
          * same type, and that each element of the objects are the same.
          * @returns true if DataStructure's are Equal.
          */
-        virtual bool equals( const DataStructure* value ) const {
-            return ActiveMQDestination::equals( value );
-        }
+        virtual bool equals( const DataStructure* value ) const;
 
         /**
          * @returns the cms::Destination interface pointer that the

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.cpp Thu May 14 18:22:39 2009
@@ -42,3 +42,30 @@
     return ActiveMQTempTopic::ID_ACTIVEMQTEMPTOPIC;
 }
 
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTempTopic* ActiveMQTempTopic::cloneDataStructure() const {
+    std::auto_ptr<ActiveMQTempTopic> message( new ActiveMQTempTopic() );
+    message->copyDataStructure( this );
+    return message.release();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQTempTopic::copyDataStructure( const DataStructure* src ) {
+    ActiveMQTempDestination::copyDataStructure( src );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQTempTopic::toString() const {
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQTempTopic" << std::endl;
+    stream << ActiveMQTempDestination::toString();
+    stream << "End Class = ActiveMQTempTopic" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQTempTopic::equals( const DataStructure* value ) const {
+    return ActiveMQDestination::equals( value );
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.h Thu May 14 18:22:39 2009
@@ -52,34 +52,19 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual ActiveMQTempTopic* cloneDataStructure() const {
-            std::auto_ptr<ActiveMQTempTopic> message( new ActiveMQTempTopic() );
-            message->copyDataStructure( this );
-            return message.release();
-        }
+        virtual ActiveMQTempTopic* cloneDataStructure() const;
 
         /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQTempDestination::copyDataStructure( src );
-        }
-
+        virtual void copyDataStructure( const DataStructure* src );
         /**
          * Converts the Destination Name into a String
          * @return string name
          */
-        virtual std::string toString() const {
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQTempTopic" << std::endl;
-            stream << ActiveMQTempDestination::toString();
-            stream << "End Class = ActiveMQTempTopic" << std::endl;
-
-            return stream.str();
-        }
+        virtual std::string toString() const;
 
         /**
          * Compares the DataStructure passed in to this one, and returns if
@@ -87,9 +72,7 @@
          * same type, and that each element of the objects are the same.
          * @returns true if DataStructure's are Equal.
          */
-        virtual bool equals( const DataStructure* value ) const {
-            return ActiveMQDestination::equals( value );
-        }
+        virtual bool equals( const DataStructure* value ) const;
 
         /**
          * @returns the cms::Destination interface pointer that the

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.cpp Thu May 14 18:22:39 2009
@@ -46,6 +46,34 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+ActiveMQTextMessage* ActiveMQTextMessage::cloneDataStructure() const {
+    std::auto_ptr<ActiveMQTextMessage> message( new ActiveMQTextMessage() );
+    message->copyDataStructure( this );
+    return message.release();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQTextMessage::copyDataStructure( const DataStructure* src ) {
+    ActiveMQMessageTemplate<cms::TextMessage>::copyDataStructure( src );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQTextMessage::toString() const {
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQTextMessage" << std::endl;
+    stream << ActiveMQMessageTemplate<cms::TextMessage>::toString();
+    stream << "End Class = ActiveMQTextMessage" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQTextMessage::equals( const DataStructure* value ) const {
+    return ActiveMQMessageTemplate<cms::TextMessage>::equals( value );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 std::string ActiveMQTextMessage::getText() const throw( cms::CMSException ) {
 
     try{

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.h Thu May 14 18:22:39 2009
@@ -51,35 +51,21 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual ActiveMQTextMessage* cloneDataStructure() const {
-            std::auto_ptr<ActiveMQTextMessage> message( new ActiveMQTextMessage() );
-            message->copyDataStructure( this );
-            return message.release();
-        }
+        virtual ActiveMQTextMessage* cloneDataStructure() const;
 
         /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQMessageTemplate<cms::TextMessage>::copyDataStructure( src );
-        }
+        virtual void copyDataStructure( const DataStructure* src );
 
         /**
          * Returns a string containing the information for this DataStructure
          * such as its type and value of its elements.
          * @return formatted string useful for debugging.
          */
-        virtual std::string toString() const {
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQTextMessage" << std::endl;
-            stream << ActiveMQMessageTemplate<cms::TextMessage>::toString();
-            stream << "End Class = ActiveMQTextMessage" << std::endl;
-
-            return stream.str();
-        }
+        virtual std::string toString() const;
 
         /**
          * Compares the DataStructure passed in to this one, and returns if
@@ -87,9 +73,7 @@
          * same type, and that each element of the objects are the same.
          * @returns true if DataStructure's are Equal.
          */
-        virtual bool equals( const DataStructure* value ) const {
-            return ActiveMQMessageTemplate<cms::TextMessage>::equals( value );
-        }
+        virtual bool equals( const DataStructure* value ) const;
 
     public:   // CMS Message
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.cpp Thu May 14 18:22:39 2009
@@ -37,3 +37,26 @@
 unsigned char ActiveMQTopic::getDataStructureType() const {
     return ActiveMQTopic::ID_ACTIVEMQTOPIC;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQTopic* ActiveMQTopic::cloneDataStructure() const {
+    std::auto_ptr<ActiveMQTopic> message( new ActiveMQTopic() );
+    message->copyDataStructure( this );
+    return message.release();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQTopic::copyDataStructure( const DataStructure* src ) {
+    ActiveMQDestination::copyDataStructure( src );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQTopic::toString() const {
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQTopic" << std::endl;
+    stream << ActiveMQDestination::toString();
+    stream << "End Class = ActiveMQTopic" << std::endl;
+
+    return stream.str();
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.h?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.h Thu May 14 18:22:39 2009
@@ -54,35 +54,21 @@
          * caller now owns, this will be an exact copy of this one
          * @returns new copy of this object.
          */
-        virtual ActiveMQTopic* cloneDataStructure() const {
-            std::auto_ptr<ActiveMQTopic> message( new ActiveMQTopic() );
-            message->copyDataStructure( this );
-            return message.release();
-        }
+        virtual ActiveMQTopic* cloneDataStructure() const;
 
         /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-            ActiveMQDestination::copyDataStructure( src );
-        }
+        virtual void copyDataStructure( const DataStructure* src );
 
         /**
          * Returns a string containing the information for this DataStructure
          * such as its type and value of its elements.
          * @return formatted string useful for debugging.
          */
-        virtual std::string toString() const {
-            std::ostringstream stream;
-
-            stream << "Begin Class = ActiveMQTopic" << std::endl;
-            stream << ActiveMQDestination::toString();
-            stream << "End Class = ActiveMQTopic" << std::endl;
-
-            return stream.str();
-        }
+        virtual std::string toString() const;
 
         /**
          * Compares the DataStructure passed in to this one, and returns if

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp Thu May 14 18:22:39 2009
@@ -19,7 +19,7 @@
 #include <activemq/exceptions/ActiveMQException.h>
 #include <activemq/state/CommandVisitor.h>
 #include <activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.h>
-#include <activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.h>
+#include <activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
 using namespace std;
@@ -819,7 +819,7 @@
 
         marshalledProperties.clear();
         if( !properties.isEmpty() ) {
-            wireformat::openwire::marshal::PrimitiveMapMarshaller::marshal(
+            wireformat::openwire::marshal::PrimitiveTypesMarshaller::marshal(
                 &properties, marshalledProperties );
         }
     }
@@ -834,7 +834,7 @@
 
     try{
 
-        wireformat::openwire::marshal::PrimitiveMapMarshaller::unmarshal(
+        wireformat::openwire::marshal::PrimitiveTypesMarshaller::unmarshal(
             &properties, marshalledProperties );
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp?rev=774861&r1=774860&r2=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp Thu May 14 18:22:39 2009
@@ -18,7 +18,7 @@
 #include <activemq/commands/WireFormatInfo.h>
 
 #include <activemq/state/CommandVisitor.h>
-#include <activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.h>
+#include <activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
 using namespace std;
@@ -320,9 +320,8 @@
     try{
 
         marshalledProperties.clear();
-        if( !properties.isEmpty() )
-        {
-            marshal::PrimitiveMapMarshaller::marshal(
+        if( !properties.isEmpty() ) {
+            marshal::PrimitiveTypesMarshaller::marshal(
                 &properties, marshalledProperties );
         }
     }
@@ -337,7 +336,7 @@
 
     try{
 
-        marshal::PrimitiveMapMarshaller::unmarshal(
+        marshal::PrimitiveTypesMarshaller::unmarshal(
             &properties, marshalledProperties );
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Copied: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp (from r774073, activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.cpp)
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp?p2=activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp&p1=activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.cpp&r1=774073&r2=774861&rev=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp Thu May 14 18:22:39 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-#include "PrimitiveMapMarshaller.h"
+#include "PrimitiveTypesMarshaller.h"
 
 #include <decaf/io/ByteArrayInputStream.h>
 #include <decaf/io/ByteArrayOutputStream.h>
@@ -37,9 +37,9 @@
 using namespace decaf::lang;
 
 ///////////////////////////////////////////////////////////////////////////////
-void PrimitiveMapMarshaller::marshal( const activemq::util::PrimitiveMap* map,
+void PrimitiveTypesMarshaller::marshal( const activemq::util::PrimitiveMap* map,
                                       std::vector<unsigned char>& dest )
-                                        throw ( cms::CMSException ) {
+                                        throw ( decaf::lang::Exception ) {
 
     try {
 
@@ -49,69 +49,78 @@
         if( map == NULL ) {
             dataOut.writeInt( -1 );
         } else {
-            PrimitiveMapMarshaller::marshalPrimitiveMap( dataOut, *map );
+            PrimitiveTypesMarshaller::marshalPrimitiveMap( dataOut, *map );
         }
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW( decaf::lang::Exception )
+    AMQ_CATCHALL_THROW( decaf::lang::Exception )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-PrimitiveMap* PrimitiveMapMarshaller::unmarshal(
-    const std::vector<unsigned char>& src )
-        throw ( cms::CMSException ) {
+void PrimitiveTypesMarshaller::unmarshal(
+    activemq::util::PrimitiveMap* map,
+    const std::vector<unsigned char>& src ) throw ( decaf::lang::Exception ) {
 
-    try{
+    try {
+
+        if( map == NULL || src.empty() ) {
+            return;
+        }
+
+        // Clear old data
+        map->clear();
 
         ByteArrayInputStream bytesIn( src );
         DataInputStream dataIn( &bytesIn );
+        PrimitiveTypesMarshaller::unmarshalPrimitiveMap( dataIn, *map );
+    }
+    AMQ_CATCH_RETHROW( decaf::lang::Exception )
+    AMQ_CATCHALL_THROW( decaf::lang::Exception )
+}
 
-        int size = dataIn.readInt();
-
-        if( size > 0 ) {
-            PrimitiveMap* map = new PrimitiveMap;
+///////////////////////////////////////////////////////////////////////////////
+void PrimitiveTypesMarshaller::marshal( const util::PrimitiveList* list,
+                                        std::vector<unsigned char>& dest )
+                                            throw ( decaf::lang::Exception ) {
+    try {
 
-            for( int i=0; i < size; i++ ) {
-                std::string key = dataIn.readUTF();
-                map->put( key, unmarshalPrimitive( dataIn ) );
-            }
+        ByteArrayOutputStream bytesOut( dest );
+        DataOutputStream dataOut( &bytesOut );
 
-            return map;
+        if( list == NULL ) {
+            dataOut.writeInt( -1 );
+        } else {
+            PrimitiveTypesMarshaller::marshalPrimitiveList( dataOut, *list );
         }
-
-        return NULL;
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW( decaf::lang::Exception )
+    AMQ_CATCHALL_THROW( decaf::lang::Exception )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-void PrimitiveMapMarshaller::unmarshal(
-    activemq::util::PrimitiveMap* map,
-    const std::vector<unsigned char>& src ) throw ( cms::CMSException ) {
+void PrimitiveTypesMarshaller::unmarshal( util::PrimitiveList* list,
+                                          const std::vector<unsigned char>& src )
+                                                throw ( decaf::lang::Exception ) {
 
     try {
 
-        if( map == NULL || src.empty() ) {
+        if( list == NULL || src.empty() ) {
             return;
         }
 
         // Clear old data
-        map->clear();
+        list->clear();
 
         ByteArrayInputStream bytesIn( src );
         DataInputStream dataIn( &bytesIn );
-        PrimitiveMapMarshaller::unmarshalPrimitiveMap( dataIn, *map );
+        PrimitiveTypesMarshaller::unmarshalPrimitiveList( dataIn, *list );
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW( decaf::lang::Exception )
+    AMQ_CATCHALL_THROW( decaf::lang::Exception )
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-void PrimitiveMapMarshaller::marshalPrimitiveMap(
+void PrimitiveTypesMarshaller::marshalPrimitiveMap(
     decaf::io::DataOutputStream& dataOut,
     const decaf::util::Map<std::string, PrimitiveValueNode>& map )
         throw ( decaf::io::IOException ) {
@@ -136,7 +145,7 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-void PrimitiveMapMarshaller::marshalPrimitiveList(
+void PrimitiveTypesMarshaller::marshalPrimitiveList(
     decaf::io::DataOutputStream& dataOut,
     const decaf::util::List<PrimitiveValueNode>& list )
         throw ( decaf::io::IOException ) {
@@ -154,7 +163,7 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-void PrimitiveMapMarshaller::marshalPrimitive( io::DataOutputStream& dataOut,
+void PrimitiveTypesMarshaller::marshalPrimitive( io::DataOutputStream& dataOut,
                                                const activemq::util::PrimitiveValueNode& value )
                                                     throw ( decaf::io::IOException ) {
 
@@ -245,7 +254,7 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-void PrimitiveMapMarshaller::unmarshalPrimitiveMap(
+void PrimitiveTypesMarshaller::unmarshalPrimitiveMap(
     decaf::io::DataInputStream& dataIn, PrimitiveMap& map )
         throw ( decaf::io::IOException ) {
 
@@ -266,7 +275,7 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-void PrimitiveMapMarshaller::unmarshalPrimitiveList(
+void PrimitiveTypesMarshaller::unmarshalPrimitiveList(
     decaf::io::DataInputStream& dataIn,
     decaf::util::StlList<PrimitiveValueNode>& list )
         throw ( decaf::io::IOException ) {
@@ -284,7 +293,7 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode PrimitiveMapMarshaller::unmarshalPrimitive(
+PrimitiveValueNode PrimitiveTypesMarshaller::unmarshalPrimitive(
     io::DataInputStream& dataIn ) throw ( decaf::io::IOException ) {
 
     try {
@@ -340,14 +349,14 @@
             case PrimitiveValueNode::LIST_TYPE:
             {
                 PrimitiveList list;
-                PrimitiveMapMarshaller::unmarshalPrimitiveList( dataIn, list );
+                PrimitiveTypesMarshaller::unmarshalPrimitiveList( dataIn, list );
                 value.setList( list );
                 break;
             }
             case PrimitiveValueNode::MAP_TYPE:
             {
                 PrimitiveMap map;
-                PrimitiveMapMarshaller::unmarshalPrimitiveMap( dataIn, map );
+                PrimitiveTypesMarshaller::unmarshalPrimitiveMap( dataIn, map );
                 value.setMap( map );
                 break;
             }
@@ -355,7 +364,7 @@
                 throw IOException(
                     __FILE__,
                     __LINE__,
-                    "PrimitiveMapMarshaller::unmarshalPrimitive - "
+                    "PrimitiveTypesMarshaller::unmarshalPrimitive - "
                     "Unsupported data type: ");
         }
 

Copied: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h (from r774073, activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.h)
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h?p2=activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h&p1=activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.h&r1=774073&r2=774861&rev=774861&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveMapMarshaller.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h Thu May 14 18:22:39 2009
@@ -15,8 +15,8 @@
  * limitations under the License.
  */
 
-#ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVEMAPMARSHALLER_H_
-#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVEMAPMARSHALLER_H_
+#ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVETYPESMARSHALLER_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVETYPESMARSHALLER_H_
 
 #include <cms/CMSException.h>
 #include <activemq/util/Config.h>
@@ -38,11 +38,11 @@
      * map to the Openwire Format's expectation of what the map looks like
      * on the wire.
      */
-    class AMQCPP_API PrimitiveMapMarshaller {
+    class AMQCPP_API PrimitiveTypesMarshaller {
     public:
 
-        PrimitiveMapMarshaller() {}
-        virtual ~PrimitiveMapMarshaller() {}
+        PrimitiveTypesMarshaller() {}
+        virtual ~PrimitiveTypesMarshaller() {}
 
         /**
          * Static Marshal of a primitive map object
@@ -52,16 +52,27 @@
          */
         static void marshal( const util::PrimitiveMap* map,
                              std::vector<unsigned char>& dest )
-                                throw ( cms::CMSException );
+                                throw ( decaf::lang::Exception );
 
         /**
          * Static Map Unmarshaler, takes an array of bytes and returns a
          * new instance of a PrimitiveMap object.  Caller owns the pointer.
+         * @param Map to Unmarshal into
          * @param reference to a byte array to read data from.
-         * @return newly create PrimitiveMap with unmarshaled data.
          */
-        static util::PrimitiveMap* unmarshal( const std::vector<unsigned char>& src )
-            throw ( cms::CMSException );
+        static void unmarshal( util::PrimitiveMap* map,
+                               const std::vector<unsigned char>& src )
+                                    throw ( decaf::lang::Exception );
+
+        /**
+         * Static Marshal of a primitive map object
+         * @param Map to Marshal
+         * @param Reference to a byte array to house the data
+         * @throws CMSException
+         */
+        static void marshal( const util::PrimitiveList* list,
+                             std::vector<unsigned char>& dest )
+                                throw ( decaf::lang::Exception );
 
         /**
          * Static Map Unmarshaler, takes an array of bytes and returns a
@@ -69,9 +80,9 @@
          * @param Map to Unmarshal into
          * @param reference to a byte array to read data from.
          */
-        static void unmarshal( util::PrimitiveMap* map,
+        static void unmarshal( util::PrimitiveList* list,
                                const std::vector<unsigned char>& src )
-                                    throw ( cms::CMSException );
+                                    throw ( decaf::lang::Exception );
 
     protected:
 
@@ -147,4 +158,4 @@
 
 }}}}
 
-#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVEMAPMARSHALLER_H_*/
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVETYPESMARSHALLER_H_*/