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/02/07 00:11:39 UTC

svn commit: r741774 [3/17] - in /activemq/activemq-cpp/trunk/src: main/ main/activemq/commands/ main/activemq/core/ main/activemq/exceptions/ main/activemq/state/ main/activemq/wireformat/openwire/marshal/ main/activemq/wireformat/openwire/marshal/v1/ ...

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/BaseCommand.h>
+#include <decaf/lang/Pointer.h>
 #include <activemq/commands/ConsumerId.h>
 #include <activemq/commands/ActiveMQDestination.h>
 #include <activemq/commands/BrokerId.h>
@@ -48,9 +49,9 @@
     class AMQCPP_API ConsumerInfo : public BaseCommand {
     protected:
 
-        ConsumerId* consumerId;
+        decaf::lang::Pointer<ConsumerId> consumerId;
         bool browser;
-        ActiveMQDestination* destination;
+        decaf::lang::Pointer<ActiveMQDestination> destination;
         int prefetchSize;
         int maximumPendingMessageLimit;
         bool dispatchAsync;
@@ -60,8 +61,8 @@
         bool exclusive;
         bool retroactive;
         unsigned char priority;
-        std::vector<BrokerId*> brokerPath;
-        BooleanExpression* additionalPredicate;
+        std::vector< decaf::lang::Pointer<BrokerId> > brokerPath;
+        decaf::lang::Pointer<BooleanExpression> additionalPredicate;
         bool networkSubscription;
         bool optimizedAcknowledge;
         bool noRangeAcks;
@@ -123,19 +124,19 @@
          * 
          * @return a Response to the visitor being called or NULL if no response.
          */
-        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+        virtual decaf::lang::Pointer<commands::Command> visit( activemq::state::CommandVisitor* visitor )
             throw( exceptions::ActiveMQException );
 
-        virtual const ConsumerId* getConsumerId() const;
-        virtual ConsumerId* getConsumerId();
-        virtual void setConsumerId( ConsumerId* consumerId );
+        virtual const decaf::lang::Pointer<ConsumerId>& getConsumerId() const;
+        virtual decaf::lang::Pointer<ConsumerId>& getConsumerId();
+        virtual void setConsumerId( const decaf::lang::Pointer<ConsumerId>& consumerId );
 
         virtual bool isBrowser() const;
         virtual void setBrowser( bool browser );
 
-        virtual const ActiveMQDestination* getDestination() const;
-        virtual ActiveMQDestination* getDestination();
-        virtual void setDestination( ActiveMQDestination* destination );
+        virtual const decaf::lang::Pointer<ActiveMQDestination>& getDestination() const;
+        virtual decaf::lang::Pointer<ActiveMQDestination>& getDestination();
+        virtual void setDestination( const decaf::lang::Pointer<ActiveMQDestination>& destination );
 
         virtual int getPrefetchSize() const;
         virtual void setPrefetchSize( int prefetchSize );
@@ -166,13 +167,13 @@
         virtual unsigned char getPriority() const;
         virtual void setPriority( unsigned char priority );
 
-        virtual const std::vector<BrokerId*>& getBrokerPath() const;
-        virtual std::vector<BrokerId*>& getBrokerPath();
-        virtual void setBrokerPath( const std::vector<BrokerId*>& brokerPath );
-
-        virtual const BooleanExpression* getAdditionalPredicate() const;
-        virtual BooleanExpression* getAdditionalPredicate();
-        virtual void setAdditionalPredicate( BooleanExpression* additionalPredicate );
+        virtual const std::vector< decaf::lang::Pointer<BrokerId> >& getBrokerPath() const;
+        virtual std::vector< decaf::lang::Pointer<BrokerId> >& getBrokerPath();
+        virtual void setBrokerPath( const std::vector< decaf::lang::Pointer<BrokerId> >& brokerPath );
+
+        virtual const decaf::lang::Pointer<BooleanExpression>& getAdditionalPredicate() const;
+        virtual decaf::lang::Pointer<BooleanExpression>& getAdditionalPredicate();
+        virtual void setAdditionalPredicate( const decaf::lang::Pointer<BooleanExpression>& additionalPredicate );
 
         virtual bool isNetworkSubscription() const;
         virtual void setNetworkSubscription( bool networkSubscription );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.cpp Fri Feb  6 23:11:28 2009
@@ -48,12 +48,12 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 ControlCommand* ControlCommand::cloneDataStructure() const {
-    ControlCommand* controlCommand = new ControlCommand();
+    std::auto_ptr<ControlCommand> controlCommand( new ControlCommand() );
 
     // Copy the data from the base class or classes
     controlCommand->copyDataStructure( this );
 
-    return controlCommand;
+    return controlCommand.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -118,7 +118,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-commands::Command* ControlCommand::visit( activemq::state::CommandVisitor* visitor ) 
+decaf::lang::Pointer<commands::Command> ControlCommand::visit( activemq::state::CommandVisitor* visitor ) 
     throw( exceptions::ActiveMQException ) {
 
     return visitor->processControlCommand( this );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/BaseCommand.h>
+#include <decaf/lang/Pointer.h>
 #include <vector>
 #include <string>
 
@@ -103,7 +104,7 @@
          * 
          * @return a Response to the visitor being called or NULL if no response.
          */
-        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+        virtual decaf::lang::Pointer<commands::Command> visit( activemq::state::CommandVisitor* visitor )
             throw( exceptions::ActiveMQException );
 
         virtual const std::string& getCommand() const;

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.cpp Fri Feb  6 23:11:28 2009
@@ -43,19 +43,16 @@
 ////////////////////////////////////////////////////////////////////////////////
 DataArrayResponse::~DataArrayResponse() {
 
-    for( size_t idata = 0; idata < data.size(); ++idata ) {
-        delete data[idata];
-    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 DataArrayResponse* DataArrayResponse::cloneDataStructure() const {
-    DataArrayResponse* dataArrayResponse = new DataArrayResponse();
+    std::auto_ptr<DataArrayResponse> dataArrayResponse( new DataArrayResponse() );
 
     // Copy the data from the base class or classes
     dataArrayResponse->copyDataStructure( this );
 
-    return dataArrayResponse;
+    return dataArrayResponse.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -76,15 +73,7 @@
             __FILE__, __LINE__,
             "DataArrayResponse::copyDataStructure - src is NULL or invalid" );
     }
-    for( size_t idata = 0; idata < srcPtr->getData().size(); ++idata ) {
-        if( srcPtr->getData()[idata] != NULL ) {
-            this->getData().push_back(
-                dynamic_cast<DataStructure*>(
-                    srcPtr->getData()[idata]->cloneDataStructure() ) );
-        } else {
-            this->getData().push_back( NULL );
-        }
-    }
+    this->setData( srcPtr->getData() );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -127,7 +116,7 @@
     }
     for( size_t idata = 0; idata < this->getData().size(); ++idata ) {
         if( this->getData()[idata] != NULL ) {
-            if( !this->getData()[idata]->equals( valuePtr->getData()[idata] ) ) {
+            if( !this->getData()[idata]->equals( valuePtr->getData()[idata].get() ) ) {
                 return false;
             }
         } else if( valuePtr->getData()[idata] != NULL ) {
@@ -141,17 +130,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const std::vector<DataStructure*>& DataArrayResponse::getData() const {
+const std::vector< decaf::lang::Pointer<DataStructure> >& DataArrayResponse::getData() const {
     return data;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<DataStructure*>& DataArrayResponse::getData() {
+std::vector< decaf::lang::Pointer<DataStructure> >& DataArrayResponse::getData() {
     return data;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void DataArrayResponse::setData( const std::vector<DataStructure*>& data ) {
+void DataArrayResponse::setData( const std::vector< decaf::lang::Pointer<DataStructure> >& data ) {
     this->data = data;
 }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/Response.h>
+#include <decaf/lang/Pointer.h>
 #include <activemq/commands/DataStructure.h>
 #include <vector>
 #include <string>
@@ -45,7 +46,7 @@
     class AMQCPP_API DataArrayResponse : public Response {
     protected:
 
-        std::vector<DataStructure*> data;
+        std::vector< decaf::lang::Pointer<DataStructure> > data;
 
     protected:
 
@@ -97,9 +98,9 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
-        virtual const std::vector<DataStructure*>& getData() const;
-        virtual std::vector<DataStructure*>& getData();
-        virtual void setData( const std::vector<DataStructure*>& data );
+        virtual const std::vector< decaf::lang::Pointer<DataStructure> >& getData() const;
+        virtual std::vector< decaf::lang::Pointer<DataStructure> >& getData();
+        virtual void setData( const std::vector< decaf::lang::Pointer<DataStructure> >& data );
 
     };
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.cpp Fri Feb  6 23:11:28 2009
@@ -38,23 +38,21 @@
 ////////////////////////////////////////////////////////////////////////////////
 DataResponse::DataResponse() {
 
-    this->data = NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 DataResponse::~DataResponse() {
 
-    delete this->data;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 DataResponse* DataResponse::cloneDataStructure() const {
-    DataResponse* dataResponse = new DataResponse();
+    std::auto_ptr<DataResponse> dataResponse( new DataResponse() );
 
     // Copy the data from the base class or classes
     dataResponse->copyDataStructure( this );
 
-    return dataResponse;
+    return dataResponse.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -75,11 +73,7 @@
             __FILE__, __LINE__,
             "DataResponse::copyDataStructure - src is NULL or invalid" );
     }
-    if( srcPtr->getData() != NULL ) {
-        this->setData(
-            dynamic_cast<DataStructure*>(
-                srcPtr->getData()->cloneDataStructure() ) );
-    }
+    this->setData( srcPtr->getData() );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -119,7 +113,7 @@
         return false;
     }
     if( this->getData() != NULL ) {
-        if( !this->getData()->equals( valuePtr->getData() ) ) {
+        if( !this->getData()->equals( valuePtr->getData().get() ) ) {
             return false;
         }
     } else if( valuePtr->getData() != NULL ) {
@@ -132,17 +126,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const DataStructure* DataResponse::getData() const {
+const decaf::lang::Pointer<DataStructure>& DataResponse::getData() const {
     return data;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-DataStructure* DataResponse::getData() {
+decaf::lang::Pointer<DataStructure>& DataResponse::getData() {
     return data;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void DataResponse::setData( DataStructure* data ) {
+void DataResponse::setData( const decaf::lang::Pointer<DataStructure>& data ) {
     this->data = data;
 }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/Response.h>
+#include <decaf/lang/Pointer.h>
 #include <activemq/commands/DataStructure.h>
 #include <vector>
 #include <string>
@@ -45,7 +46,7 @@
     class AMQCPP_API DataResponse : public Response {
     protected:
 
-        DataStructure* data;
+        decaf::lang::Pointer<DataStructure> data;
 
     protected:
 
@@ -97,9 +98,9 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
-        virtual const DataStructure* getData() const;
-        virtual DataStructure* getData();
-        virtual void setData( DataStructure* data );
+        virtual const decaf::lang::Pointer<DataStructure>& getData() const;
+        virtual decaf::lang::Pointer<DataStructure>& getData();
+        virtual void setData( const decaf::lang::Pointer<DataStructure>& data );
 
     };
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.cpp Fri Feb  6 23:11:28 2009
@@ -38,8 +38,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 DestinationInfo::DestinationInfo() {
 
-    this->connectionId = NULL;
-    this->destination = NULL;
     this->operationType = 0;
     this->timeout = 0;
 }
@@ -47,21 +45,16 @@
 ////////////////////////////////////////////////////////////////////////////////
 DestinationInfo::~DestinationInfo() {
 
-    delete this->connectionId;
-    delete this->destination;
-    for( size_t ibrokerPath = 0; ibrokerPath < brokerPath.size(); ++ibrokerPath ) {
-        delete brokerPath[ibrokerPath];
-    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 DestinationInfo* DestinationInfo::cloneDataStructure() const {
-    DestinationInfo* destinationInfo = new DestinationInfo();
+    std::auto_ptr<DestinationInfo> destinationInfo( new DestinationInfo() );
 
     // Copy the data from the base class or classes
     destinationInfo->copyDataStructure( this );
 
-    return destinationInfo;
+    return destinationInfo.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -82,27 +75,11 @@
             __FILE__, __LINE__,
             "DestinationInfo::copyDataStructure - src is NULL or invalid" );
     }
-    if( srcPtr->getConnectionId() != NULL ) {
-        this->setConnectionId(
-            dynamic_cast<ConnectionId*>(
-                srcPtr->getConnectionId()->cloneDataStructure() ) );
-    }
-    if( srcPtr->getDestination() != NULL ) {
-        this->setDestination(
-            dynamic_cast<ActiveMQDestination*>(
-                srcPtr->getDestination()->cloneDataStructure() ) );
-    }
+    this->setConnectionId( srcPtr->getConnectionId() );
+    this->setDestination( srcPtr->getDestination() );
     this->setOperationType( srcPtr->getOperationType() );
     this->setTimeout( srcPtr->getTimeout() );
-    for( size_t ibrokerPath = 0; ibrokerPath < srcPtr->getBrokerPath().size(); ++ibrokerPath ) {
-        if( srcPtr->getBrokerPath()[ibrokerPath] != NULL ) {
-            this->getBrokerPath().push_back(
-                dynamic_cast<BrokerId*>(
-                    srcPtr->getBrokerPath()[ibrokerPath]->cloneDataStructure() ) );
-        } else {
-            this->getBrokerPath().push_back( NULL );
-        }
-    }
+    this->setBrokerPath( srcPtr->getBrokerPath() );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -158,14 +135,14 @@
         return false;
     }
     if( this->getConnectionId() != NULL ) {
-        if( !this->getConnectionId()->equals( valuePtr->getConnectionId() ) ) {
+        if( !this->getConnectionId()->equals( valuePtr->getConnectionId().get() ) ) {
             return false;
         }
     } else if( valuePtr->getConnectionId() != NULL ) {
         return false;
     }
     if( this->getDestination() != NULL ) {
-        if( !this->getDestination()->equals( valuePtr->getDestination() ) ) {
+        if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) {
             return false;
         }
     } else if( valuePtr->getDestination() != NULL ) {
@@ -179,7 +156,7 @@
     }
     for( size_t ibrokerPath = 0; ibrokerPath < this->getBrokerPath().size(); ++ibrokerPath ) {
         if( this->getBrokerPath()[ibrokerPath] != NULL ) {
-            if( !this->getBrokerPath()[ibrokerPath]->equals( valuePtr->getBrokerPath()[ibrokerPath] ) ) {
+            if( !this->getBrokerPath()[ibrokerPath]->equals( valuePtr->getBrokerPath()[ibrokerPath].get() ) ) {
                 return false;
             }
         } else if( valuePtr->getBrokerPath()[ibrokerPath] != NULL ) {
@@ -193,39 +170,39 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-commands::Command* DestinationInfo::visit( activemq::state::CommandVisitor* visitor ) 
+decaf::lang::Pointer<commands::Command> DestinationInfo::visit( activemq::state::CommandVisitor* visitor ) 
     throw( exceptions::ActiveMQException ) {
 
     return visitor->processDestinationInfo( this );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const ConnectionId* DestinationInfo::getConnectionId() const {
+const decaf::lang::Pointer<ConnectionId>& DestinationInfo::getConnectionId() const {
     return connectionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ConnectionId* DestinationInfo::getConnectionId() {
+decaf::lang::Pointer<ConnectionId>& DestinationInfo::getConnectionId() {
     return connectionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void DestinationInfo::setConnectionId( ConnectionId* connectionId ) {
+void DestinationInfo::setConnectionId( const decaf::lang::Pointer<ConnectionId>& connectionId ) {
     this->connectionId = connectionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const ActiveMQDestination* DestinationInfo::getDestination() const {
+const decaf::lang::Pointer<ActiveMQDestination>& DestinationInfo::getDestination() const {
     return destination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ActiveMQDestination* DestinationInfo::getDestination() {
+decaf::lang::Pointer<ActiveMQDestination>& DestinationInfo::getDestination() {
     return destination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void DestinationInfo::setDestination( ActiveMQDestination* destination ) {
+void DestinationInfo::setDestination( const decaf::lang::Pointer<ActiveMQDestination>& destination ) {
     this->destination = destination;
 }
 
@@ -250,17 +227,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const std::vector<BrokerId*>& DestinationInfo::getBrokerPath() const {
+const std::vector< decaf::lang::Pointer<BrokerId> >& DestinationInfo::getBrokerPath() const {
     return brokerPath;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<BrokerId*>& DestinationInfo::getBrokerPath() {
+std::vector< decaf::lang::Pointer<BrokerId> >& DestinationInfo::getBrokerPath() {
     return brokerPath;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void DestinationInfo::setBrokerPath( const std::vector<BrokerId*>& brokerPath ) {
+void DestinationInfo::setBrokerPath( const std::vector< decaf::lang::Pointer<BrokerId> >& brokerPath ) {
     this->brokerPath = brokerPath;
 }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/BaseCommand.h>
+#include <decaf/lang/Pointer.h>
 #include <activemq/commands/ConnectionId.h>
 #include <activemq/commands/ActiveMQDestination.h>
 #include <activemq/commands/BrokerId.h>
@@ -47,11 +48,11 @@
     class AMQCPP_API DestinationInfo : public BaseCommand {
     protected:
 
-        ConnectionId* connectionId;
-        ActiveMQDestination* destination;
+        decaf::lang::Pointer<ConnectionId> connectionId;
+        decaf::lang::Pointer<ActiveMQDestination> destination;
         unsigned char operationType;
         long long timeout;
-        std::vector<BrokerId*> brokerPath;
+        std::vector< decaf::lang::Pointer<BrokerId> > brokerPath;
 
     protected:
 
@@ -110,16 +111,16 @@
          * 
          * @return a Response to the visitor being called or NULL if no response.
          */
-        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+        virtual decaf::lang::Pointer<commands::Command> visit( activemq::state::CommandVisitor* visitor )
             throw( exceptions::ActiveMQException );
 
-        virtual const ConnectionId* getConnectionId() const;
-        virtual ConnectionId* getConnectionId();
-        virtual void setConnectionId( ConnectionId* connectionId );
-
-        virtual const ActiveMQDestination* getDestination() const;
-        virtual ActiveMQDestination* getDestination();
-        virtual void setDestination( ActiveMQDestination* destination );
+        virtual const decaf::lang::Pointer<ConnectionId>& getConnectionId() const;
+        virtual decaf::lang::Pointer<ConnectionId>& getConnectionId();
+        virtual void setConnectionId( const decaf::lang::Pointer<ConnectionId>& connectionId );
+
+        virtual const decaf::lang::Pointer<ActiveMQDestination>& getDestination() const;
+        virtual decaf::lang::Pointer<ActiveMQDestination>& getDestination();
+        virtual void setDestination( const decaf::lang::Pointer<ActiveMQDestination>& destination );
 
         virtual unsigned char getOperationType() const;
         virtual void setOperationType( unsigned char operationType );
@@ -127,9 +128,9 @@
         virtual long long getTimeout() const;
         virtual void setTimeout( long long timeout );
 
-        virtual const std::vector<BrokerId*>& getBrokerPath() const;
-        virtual std::vector<BrokerId*>& getBrokerPath();
-        virtual void setBrokerPath( const std::vector<BrokerId*>& brokerPath );
+        virtual const std::vector< decaf::lang::Pointer<BrokerId> >& getBrokerPath() const;
+        virtual std::vector< decaf::lang::Pointer<BrokerId> >& getBrokerPath();
+        virtual void setBrokerPath( const std::vector< decaf::lang::Pointer<BrokerId> >& brokerPath );
 
     };
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.cpp Fri Feb  6 23:11:28 2009
@@ -49,12 +49,12 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 DiscoveryEvent* DiscoveryEvent::cloneDataStructure() const {
-    DiscoveryEvent* discoveryEvent = new DiscoveryEvent();
+    std::auto_ptr<DiscoveryEvent> discoveryEvent( new DiscoveryEvent() );
 
     // Copy the data from the base class or classes
     discoveryEvent->copyDataStructure( this );
 
-    return discoveryEvent;
+    return discoveryEvent.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/BaseDataStructure.h>
+#include <decaf/lang/Pointer.h>
 #include <vector>
 #include <string>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.cpp Fri Feb  6 23:11:28 2009
@@ -38,23 +38,21 @@
 ////////////////////////////////////////////////////////////////////////////////
 ExceptionResponse::ExceptionResponse() {
 
-    this->exception = NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 ExceptionResponse::~ExceptionResponse() {
 
-    delete this->exception;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 ExceptionResponse* ExceptionResponse::cloneDataStructure() const {
-    ExceptionResponse* exceptionResponse = new ExceptionResponse();
+    std::auto_ptr<ExceptionResponse> exceptionResponse( new ExceptionResponse() );
 
     // Copy the data from the base class or classes
     exceptionResponse->copyDataStructure( this );
 
-    return exceptionResponse;
+    return exceptionResponse.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -75,11 +73,7 @@
             __FILE__, __LINE__,
             "ExceptionResponse::copyDataStructure - src is NULL or invalid" );
     }
-    if( srcPtr->getException() != NULL ) {
-        this->setException(
-            dynamic_cast<BrokerError*>(
-                srcPtr->getException()->cloneDataStructure() ) );
-    }
+    this->setException( srcPtr->getException() );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -119,7 +113,7 @@
         return false;
     }
     if( this->getException() != NULL ) {
-        if( !this->getException()->equals( valuePtr->getException() ) ) {
+        if( !this->getException()->equals( valuePtr->getException().get() ) ) {
             return false;
         }
     } else if( valuePtr->getException() != NULL ) {
@@ -132,17 +126,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const BrokerError* ExceptionResponse::getException() const {
+const decaf::lang::Pointer<BrokerError>& ExceptionResponse::getException() const {
     return exception;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-BrokerError* ExceptionResponse::getException() {
+decaf::lang::Pointer<BrokerError>& ExceptionResponse::getException() {
     return exception;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ExceptionResponse::setException( BrokerError* exception ) {
+void ExceptionResponse::setException( const decaf::lang::Pointer<BrokerError>& exception ) {
     this->exception = exception;
 }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/Response.h>
+#include <decaf/lang/Pointer.h>
 #include <activemq/commands/BrokerError.h>
 #include <vector>
 #include <string>
@@ -45,7 +46,7 @@
     class AMQCPP_API ExceptionResponse : public Response {
     protected:
 
-        BrokerError* exception;
+        decaf::lang::Pointer<BrokerError> exception;
 
     protected:
 
@@ -97,9 +98,9 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
-        virtual const BrokerError* getException() const;
-        virtual BrokerError* getException();
-        virtual void setException( BrokerError* exception );
+        virtual const decaf::lang::Pointer<BrokerError>& getException() const;
+        virtual decaf::lang::Pointer<BrokerError>& getException();
+        virtual void setException( const decaf::lang::Pointer<BrokerError>& exception );
 
     };
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.cpp Fri Feb  6 23:11:28 2009
@@ -47,12 +47,12 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 FlushCommand* FlushCommand::cloneDataStructure() const {
-    FlushCommand* flushCommand = new FlushCommand();
+    std::auto_ptr<FlushCommand> flushCommand( new FlushCommand() );
 
     // Copy the data from the base class or classes
     flushCommand->copyDataStructure( this );
 
-    return flushCommand;
+    return flushCommand.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -112,7 +112,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-commands::Command* FlushCommand::visit( activemq::state::CommandVisitor* visitor ) 
+decaf::lang::Pointer<commands::Command> FlushCommand::visit( activemq::state::CommandVisitor* visitor ) 
     throw( exceptions::ActiveMQException ) {
 
     return visitor->processFlushCommand( this );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/BaseCommand.h>
+#include <decaf/lang/Pointer.h>
 #include <vector>
 #include <string>
 
@@ -102,7 +103,7 @@
          * 
          * @return a Response to the visitor being called or NULL if no response.
          */
-        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+        virtual decaf::lang::Pointer<commands::Command> visit( activemq::state::CommandVisitor* visitor )
             throw( exceptions::ActiveMQException );
 
     };

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.cpp Fri Feb  6 23:11:28 2009
@@ -48,12 +48,12 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 IntegerResponse* IntegerResponse::cloneDataStructure() const {
-    IntegerResponse* integerResponse = new IntegerResponse();
+    std::auto_ptr<IntegerResponse> integerResponse( new IntegerResponse() );
 
     // Copy the data from the base class or classes
     integerResponse->copyDataStructure( this );
 
-    return integerResponse;
+    return integerResponse.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/Response.h>
+#include <decaf/lang/Pointer.h>
 #include <vector>
 #include <string>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp Fri Feb  6 23:11:28 2009
@@ -38,25 +38,21 @@
 ////////////////////////////////////////////////////////////////////////////////
 JournalQueueAck::JournalQueueAck() {
 
-    this->destination = NULL;
-    this->messageAck = NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 JournalQueueAck::~JournalQueueAck() {
 
-    delete this->destination;
-    delete this->messageAck;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 JournalQueueAck* JournalQueueAck::cloneDataStructure() const {
-    JournalQueueAck* journalQueueAck = new JournalQueueAck();
+    std::auto_ptr<JournalQueueAck> journalQueueAck( new JournalQueueAck() );
 
     // Copy the data from the base class or classes
     journalQueueAck->copyDataStructure( this );
 
-    return journalQueueAck;
+    return journalQueueAck.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -77,16 +73,8 @@
             __FILE__, __LINE__,
             "JournalQueueAck::copyDataStructure - src is NULL or invalid" );
     }
-    if( srcPtr->getDestination() != NULL ) {
-        this->setDestination(
-            dynamic_cast<ActiveMQDestination*>(
-                srcPtr->getDestination()->cloneDataStructure() ) );
-    }
-    if( srcPtr->getMessageAck() != NULL ) {
-        this->setMessageAck(
-            dynamic_cast<MessageAck*>(
-                srcPtr->getMessageAck()->cloneDataStructure() ) );
-    }
+    this->setDestination( srcPtr->getDestination() );
+    this->setMessageAck( srcPtr->getMessageAck() );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -132,14 +120,14 @@
         return false;
     }
     if( this->getDestination() != NULL ) {
-        if( !this->getDestination()->equals( valuePtr->getDestination() ) ) {
+        if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) {
             return false;
         }
     } else if( valuePtr->getDestination() != NULL ) {
         return false;
     }
     if( this->getMessageAck() != NULL ) {
-        if( !this->getMessageAck()->equals( valuePtr->getMessageAck() ) ) {
+        if( !this->getMessageAck()->equals( valuePtr->getMessageAck().get() ) ) {
             return false;
         }
     } else if( valuePtr->getMessageAck() != NULL ) {
@@ -152,32 +140,32 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const ActiveMQDestination* JournalQueueAck::getDestination() const {
+const decaf::lang::Pointer<ActiveMQDestination>& JournalQueueAck::getDestination() const {
     return destination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ActiveMQDestination* JournalQueueAck::getDestination() {
+decaf::lang::Pointer<ActiveMQDestination>& JournalQueueAck::getDestination() {
     return destination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void JournalQueueAck::setDestination( ActiveMQDestination* destination ) {
+void JournalQueueAck::setDestination( const decaf::lang::Pointer<ActiveMQDestination>& destination ) {
     this->destination = destination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const MessageAck* JournalQueueAck::getMessageAck() const {
+const decaf::lang::Pointer<MessageAck>& JournalQueueAck::getMessageAck() const {
     return messageAck;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-MessageAck* JournalQueueAck::getMessageAck() {
+decaf::lang::Pointer<MessageAck>& JournalQueueAck::getMessageAck() {
     return messageAck;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void JournalQueueAck::setMessageAck( MessageAck* messageAck ) {
+void JournalQueueAck::setMessageAck( const decaf::lang::Pointer<MessageAck>& messageAck ) {
     this->messageAck = messageAck;
 }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/BaseDataStructure.h>
+#include <decaf/lang/Pointer.h>
 #include <activemq/commands/ActiveMQDestination.h>
 #include <activemq/commands/MessageAck.h>
 #include <vector>
@@ -46,8 +47,8 @@
     class AMQCPP_API JournalQueueAck : public BaseDataStructure {
     protected:
 
-        ActiveMQDestination* destination;
-        MessageAck* messageAck;
+        decaf::lang::Pointer<ActiveMQDestination> destination;
+        decaf::lang::Pointer<MessageAck> messageAck;
 
     protected:
 
@@ -99,13 +100,13 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
-        virtual const ActiveMQDestination* getDestination() const;
-        virtual ActiveMQDestination* getDestination();
-        virtual void setDestination( ActiveMQDestination* destination );
-
-        virtual const MessageAck* getMessageAck() const;
-        virtual MessageAck* getMessageAck();
-        virtual void setMessageAck( MessageAck* messageAck );
+        virtual const decaf::lang::Pointer<ActiveMQDestination>& getDestination() const;
+        virtual decaf::lang::Pointer<ActiveMQDestination>& getDestination();
+        virtual void setDestination( const decaf::lang::Pointer<ActiveMQDestination>& destination );
+
+        virtual const decaf::lang::Pointer<MessageAck>& getMessageAck() const;
+        virtual decaf::lang::Pointer<MessageAck>& getMessageAck();
+        virtual void setMessageAck( const decaf::lang::Pointer<MessageAck>& messageAck );
 
     };
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp Fri Feb  6 23:11:28 2009
@@ -38,30 +38,24 @@
 ////////////////////////////////////////////////////////////////////////////////
 JournalTopicAck::JournalTopicAck() {
 
-    this->destination = NULL;
-    this->messageId = NULL;
     this->messageSequenceId = 0;
     this->subscritionName = "";
     this->clientId = "";
-    this->transactionId = NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 JournalTopicAck::~JournalTopicAck() {
 
-    delete this->destination;
-    delete this->messageId;
-    delete this->transactionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 JournalTopicAck* JournalTopicAck::cloneDataStructure() const {
-    JournalTopicAck* journalTopicAck = new JournalTopicAck();
+    std::auto_ptr<JournalTopicAck> journalTopicAck( new JournalTopicAck() );
 
     // Copy the data from the base class or classes
     journalTopicAck->copyDataStructure( this );
 
-    return journalTopicAck;
+    return journalTopicAck.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -82,24 +76,12 @@
             __FILE__, __LINE__,
             "JournalTopicAck::copyDataStructure - src is NULL or invalid" );
     }
-    if( srcPtr->getDestination() != NULL ) {
-        this->setDestination(
-            dynamic_cast<ActiveMQDestination*>(
-                srcPtr->getDestination()->cloneDataStructure() ) );
-    }
-    if( srcPtr->getMessageId() != NULL ) {
-        this->setMessageId(
-            dynamic_cast<MessageId*>(
-                srcPtr->getMessageId()->cloneDataStructure() ) );
-    }
+    this->setDestination( srcPtr->getDestination() );
+    this->setMessageId( srcPtr->getMessageId() );
     this->setMessageSequenceId( srcPtr->getMessageSequenceId() );
     this->setSubscritionName( srcPtr->getSubscritionName() );
     this->setClientId( srcPtr->getClientId() );
-    if( srcPtr->getTransactionId() != NULL ) {
-        this->setTransactionId(
-            dynamic_cast<TransactionId*>(
-                srcPtr->getTransactionId()->cloneDataStructure() ) );
-    }
+    this->setTransactionId( srcPtr->getTransactionId() );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -154,14 +136,14 @@
         return false;
     }
     if( this->getDestination() != NULL ) {
-        if( !this->getDestination()->equals( valuePtr->getDestination() ) ) {
+        if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) {
             return false;
         }
     } else if( valuePtr->getDestination() != NULL ) {
         return false;
     }
     if( this->getMessageId() != NULL ) {
-        if( !this->getMessageId()->equals( valuePtr->getMessageId() ) ) {
+        if( !this->getMessageId()->equals( valuePtr->getMessageId().get() ) ) {
             return false;
         }
     } else if( valuePtr->getMessageId() != NULL ) {
@@ -177,7 +159,7 @@
         return false;
     }
     if( this->getTransactionId() != NULL ) {
-        if( !this->getTransactionId()->equals( valuePtr->getTransactionId() ) ) {
+        if( !this->getTransactionId()->equals( valuePtr->getTransactionId().get() ) ) {
             return false;
         }
     } else if( valuePtr->getTransactionId() != NULL ) {
@@ -190,32 +172,32 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const ActiveMQDestination* JournalTopicAck::getDestination() const {
+const decaf::lang::Pointer<ActiveMQDestination>& JournalTopicAck::getDestination() const {
     return destination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ActiveMQDestination* JournalTopicAck::getDestination() {
+decaf::lang::Pointer<ActiveMQDestination>& JournalTopicAck::getDestination() {
     return destination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void JournalTopicAck::setDestination( ActiveMQDestination* destination ) {
+void JournalTopicAck::setDestination( const decaf::lang::Pointer<ActiveMQDestination>& destination ) {
     this->destination = destination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const MessageId* JournalTopicAck::getMessageId() const {
+const decaf::lang::Pointer<MessageId>& JournalTopicAck::getMessageId() const {
     return messageId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-MessageId* JournalTopicAck::getMessageId() {
+decaf::lang::Pointer<MessageId>& JournalTopicAck::getMessageId() {
     return messageId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void JournalTopicAck::setMessageId( MessageId* messageId ) {
+void JournalTopicAck::setMessageId( const decaf::lang::Pointer<MessageId>& messageId ) {
     this->messageId = messageId;
 }
 
@@ -260,17 +242,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const TransactionId* JournalTopicAck::getTransactionId() const {
+const decaf::lang::Pointer<TransactionId>& JournalTopicAck::getTransactionId() const {
     return transactionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-TransactionId* JournalTopicAck::getTransactionId() {
+decaf::lang::Pointer<TransactionId>& JournalTopicAck::getTransactionId() {
     return transactionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void JournalTopicAck::setTransactionId( TransactionId* transactionId ) {
+void JournalTopicAck::setTransactionId( const decaf::lang::Pointer<TransactionId>& transactionId ) {
     this->transactionId = transactionId;
 }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/BaseDataStructure.h>
+#include <decaf/lang/Pointer.h>
 #include <activemq/commands/ActiveMQDestination.h>
 #include <activemq/commands/MessageId.h>
 #include <activemq/commands/TransactionId.h>
@@ -47,12 +48,12 @@
     class AMQCPP_API JournalTopicAck : public BaseDataStructure {
     protected:
 
-        ActiveMQDestination* destination;
-        MessageId* messageId;
+        decaf::lang::Pointer<ActiveMQDestination> destination;
+        decaf::lang::Pointer<MessageId> messageId;
         long long messageSequenceId;
         std::string subscritionName;
         std::string clientId;
-        TransactionId* transactionId;
+        decaf::lang::Pointer<TransactionId> transactionId;
 
     protected:
 
@@ -104,13 +105,13 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
-        virtual const ActiveMQDestination* getDestination() const;
-        virtual ActiveMQDestination* getDestination();
-        virtual void setDestination( ActiveMQDestination* destination );
-
-        virtual const MessageId* getMessageId() const;
-        virtual MessageId* getMessageId();
-        virtual void setMessageId( MessageId* messageId );
+        virtual const decaf::lang::Pointer<ActiveMQDestination>& getDestination() const;
+        virtual decaf::lang::Pointer<ActiveMQDestination>& getDestination();
+        virtual void setDestination( const decaf::lang::Pointer<ActiveMQDestination>& destination );
+
+        virtual const decaf::lang::Pointer<MessageId>& getMessageId() const;
+        virtual decaf::lang::Pointer<MessageId>& getMessageId();
+        virtual void setMessageId( const decaf::lang::Pointer<MessageId>& messageId );
 
         virtual long long getMessageSequenceId() const;
         virtual void setMessageSequenceId( long long messageSequenceId );
@@ -123,9 +124,9 @@
         virtual std::string& getClientId();
         virtual void setClientId( const std::string& clientId );
 
-        virtual const TransactionId* getTransactionId() const;
-        virtual TransactionId* getTransactionId();
-        virtual void setTransactionId( TransactionId* transactionId );
+        virtual const decaf::lang::Pointer<TransactionId>& getTransactionId() const;
+        virtual decaf::lang::Pointer<TransactionId>& getTransactionId();
+        virtual void setTransactionId( const decaf::lang::Pointer<TransactionId>& transactionId );
 
     };
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.cpp Fri Feb  6 23:11:28 2009
@@ -48,12 +48,12 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 JournalTrace* JournalTrace::cloneDataStructure() const {
-    JournalTrace* journalTrace = new JournalTrace();
+    std::auto_ptr<JournalTrace> journalTrace( new JournalTrace() );
 
     // Copy the data from the base class or classes
     journalTrace->copyDataStructure( this );
 
-    return journalTrace;
+    return journalTrace.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/BaseDataStructure.h>
+#include <decaf/lang/Pointer.h>
 #include <vector>
 #include <string>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.cpp Fri Feb  6 23:11:28 2009
@@ -38,7 +38,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 JournalTransaction::JournalTransaction() {
 
-    this->transactionId = NULL;
     this->type = 0;
     this->wasPrepared = false;
 }
@@ -46,17 +45,16 @@
 ////////////////////////////////////////////////////////////////////////////////
 JournalTransaction::~JournalTransaction() {
 
-    delete this->transactionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 JournalTransaction* JournalTransaction::cloneDataStructure() const {
-    JournalTransaction* journalTransaction = new JournalTransaction();
+    std::auto_ptr<JournalTransaction> journalTransaction( new JournalTransaction() );
 
     // Copy the data from the base class or classes
     journalTransaction->copyDataStructure( this );
 
-    return journalTransaction;
+    return journalTransaction.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -77,11 +75,7 @@
             __FILE__, __LINE__,
             "JournalTransaction::copyDataStructure - src is NULL or invalid" );
     }
-    if( srcPtr->getTransactionId() != NULL ) {
-        this->setTransactionId(
-            dynamic_cast<TransactionId*>(
-                srcPtr->getTransactionId()->cloneDataStructure() ) );
-    }
+    this->setTransactionId( srcPtr->getTransactionId() );
     this->setType( srcPtr->getType() );
     this->setWasPrepared( srcPtr->getWasPrepared() );
 }
@@ -125,7 +119,7 @@
         return false;
     }
     if( this->getTransactionId() != NULL ) {
-        if( !this->getTransactionId()->equals( valuePtr->getTransactionId() ) ) {
+        if( !this->getTransactionId()->equals( valuePtr->getTransactionId().get() ) ) {
             return false;
         }
     } else if( valuePtr->getTransactionId() != NULL ) {
@@ -144,17 +138,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const TransactionId* JournalTransaction::getTransactionId() const {
+const decaf::lang::Pointer<TransactionId>& JournalTransaction::getTransactionId() const {
     return transactionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-TransactionId* JournalTransaction::getTransactionId() {
+decaf::lang::Pointer<TransactionId>& JournalTransaction::getTransactionId() {
     return transactionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void JournalTransaction::setTransactionId( TransactionId* transactionId ) {
+void JournalTransaction::setTransactionId( const decaf::lang::Pointer<TransactionId>& transactionId ) {
     this->transactionId = transactionId;
 }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/BaseDataStructure.h>
+#include <decaf/lang/Pointer.h>
 #include <activemq/commands/TransactionId.h>
 #include <vector>
 #include <string>
@@ -45,7 +46,7 @@
     class AMQCPP_API JournalTransaction : public BaseDataStructure {
     protected:
 
-        TransactionId* transactionId;
+        decaf::lang::Pointer<TransactionId> transactionId;
         unsigned char type;
         bool wasPrepared;
 
@@ -99,9 +100,9 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
-        virtual const TransactionId* getTransactionId() const;
-        virtual TransactionId* getTransactionId();
-        virtual void setTransactionId( TransactionId* transactionId );
+        virtual const decaf::lang::Pointer<TransactionId>& getTransactionId() const;
+        virtual decaf::lang::Pointer<TransactionId>& getTransactionId();
+        virtual void setTransactionId( const decaf::lang::Pointer<TransactionId>& transactionId );
 
         virtual unsigned char getType() const;
         virtual void setType( unsigned char type );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.cpp Fri Feb  6 23:11:28 2009
@@ -47,12 +47,12 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 KeepAliveInfo* KeepAliveInfo::cloneDataStructure() const {
-    KeepAliveInfo* keepAliveInfo = new KeepAliveInfo();
+    std::auto_ptr<KeepAliveInfo> keepAliveInfo( new KeepAliveInfo() );
 
     // Copy the data from the base class or classes
     keepAliveInfo->copyDataStructure( this );
 
-    return keepAliveInfo;
+    return keepAliveInfo.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -112,7 +112,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-commands::Command* KeepAliveInfo::visit( activemq::state::CommandVisitor* visitor ) 
+decaf::lang::Pointer<commands::Command> KeepAliveInfo::visit( activemq::state::CommandVisitor* visitor ) 
     throw( exceptions::ActiveMQException ) {
 
     return visitor->processKeepAliveInfo( this );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/BaseCommand.h>
+#include <decaf/lang/Pointer.h>
 #include <vector>
 #include <string>
 
@@ -102,7 +103,7 @@
          * 
          * @return a Response to the visitor being called or NULL if no response.
          */
-        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+        virtual decaf::lang::Pointer<commands::Command> visit( activemq::state::CommandVisitor* visitor )
             throw( exceptions::ActiveMQException );
 
     };

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.cpp Fri Feb  6 23:11:28 2009
@@ -47,12 +47,12 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 LastPartialCommand* LastPartialCommand::cloneDataStructure() const {
-    LastPartialCommand* lastPartialCommand = new LastPartialCommand();
+    std::auto_ptr<LastPartialCommand> lastPartialCommand( new LastPartialCommand() );
 
     // Copy the data from the base class or classes
     lastPartialCommand->copyDataStructure( this );
 
-    return lastPartialCommand;
+    return lastPartialCommand.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/PartialCommand.h>
+#include <decaf/lang/Pointer.h>
 #include <vector>
 #include <string>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.cpp Fri Feb  6 23:11:28 2009
@@ -40,7 +40,6 @@
 LocalTransactionId::LocalTransactionId() {
 
     this->value = 0;
-    this->connectionId = NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -51,17 +50,16 @@
 ////////////////////////////////////////////////////////////////////////////////
 LocalTransactionId::~LocalTransactionId() {
 
-    delete this->connectionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 LocalTransactionId* LocalTransactionId::cloneDataStructure() const {
-    LocalTransactionId* localTransactionId = new LocalTransactionId();
+    std::auto_ptr<LocalTransactionId> localTransactionId( new LocalTransactionId() );
 
     // Copy the data from the base class or classes
     localTransactionId->copyDataStructure( this );
 
-    return localTransactionId;
+    return localTransactionId.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -83,11 +81,7 @@
             "LocalTransactionId::copyDataStructure - src is NULL or invalid" );
     }
     this->setValue( srcPtr->getValue() );
-    if( srcPtr->getConnectionId() != NULL ) {
-        this->setConnectionId(
-            dynamic_cast<ConnectionId*>(
-                srcPtr->getConnectionId()->cloneDataStructure() ) );
-    }
+    this->setConnectionId( srcPtr->getConnectionId() );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -131,7 +125,7 @@
         return false;
     }
     if( this->getConnectionId() != NULL ) {
-        if( !this->getConnectionId()->equals( valuePtr->getConnectionId() ) ) {
+        if( !this->getConnectionId()->equals( valuePtr->getConnectionId().get() ) ) {
             return false;
         }
     } else if( valuePtr->getConnectionId() != NULL ) {
@@ -154,17 +148,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const ConnectionId* LocalTransactionId::getConnectionId() const {
+const decaf::lang::Pointer<ConnectionId>& LocalTransactionId::getConnectionId() const {
     return connectionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ConnectionId* LocalTransactionId::getConnectionId() {
+decaf::lang::Pointer<ConnectionId>& LocalTransactionId::getConnectionId() {
     return connectionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void LocalTransactionId::setConnectionId( ConnectionId* connectionId ) {
+void LocalTransactionId::setConnectionId( const decaf::lang::Pointer<ConnectionId>& connectionId ) {
     this->connectionId = connectionId;
 }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.h?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.h Fri Feb  6 23:11:28 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/TransactionId.h>
+#include <decaf/lang/Pointer.h>
 #include <decaf/lang/Comparable.h>
 #include <activemq/commands/ConnectionId.h>
 #include <vector>
@@ -47,12 +48,14 @@
     protected:
 
         long long value;
-        ConnectionId* connectionId;
+        decaf::lang::Pointer<ConnectionId> connectionId;
 
     public:
 
         const static unsigned char ID_LOCALTRANSACTIONID = 111;
 
+        typedef decaf::lang::PointerComparator<LocalTransactionId> COMPARATOR;
+
     public:
 
         LocalTransactionId();
@@ -98,9 +101,9 @@
         virtual long long getValue() const;
         virtual void setValue( long long value );
 
-        virtual const ConnectionId* getConnectionId() const;
-        virtual ConnectionId* getConnectionId();
-        virtual void setConnectionId( ConnectionId* connectionId );
+        virtual const decaf::lang::Pointer<ConnectionId>& getConnectionId() const;
+        virtual decaf::lang::Pointer<ConnectionId>& getConnectionId();
+        virtual void setConnectionId( const decaf::lang::Pointer<ConnectionId>& connectionId );
 
         virtual int compareTo( const LocalTransactionId& value ) const;
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.cpp?rev=741774&r1=741773&r2=741774&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.cpp Fri Feb  6 23:11:28 2009
@@ -38,23 +38,14 @@
 ////////////////////////////////////////////////////////////////////////////////
 Message::Message() {
 
-    this->producerId = NULL;
-    this->destination = NULL;
-    this->transactionId = NULL;
-    this->originalDestination = NULL;
-    this->messageId = NULL;
-    this->originalTransactionId = NULL;
     this->groupID = "";
     this->groupSequence = 0;
     this->correlationId = "";
     this->persistent = false;
     this->expiration = 0;
     this->priority = 0;
-    this->replyTo = NULL;
     this->timestamp = 0;
     this->type = "";
-    this->dataStructure = NULL;
-    this->targetConsumerId = NULL;
     this->compressed = false;
     this->redeliveryCounter = 0;
     this->arrival = 0;
@@ -68,31 +59,16 @@
 ////////////////////////////////////////////////////////////////////////////////
 Message::~Message() {
 
-    delete this->producerId;
-    delete this->destination;
-    delete this->transactionId;
-    delete this->originalDestination;
-    delete this->messageId;
-    delete this->originalTransactionId;
-    delete this->replyTo;
-    delete this->dataStructure;
-    delete this->targetConsumerId;
-    for( size_t ibrokerPath = 0; ibrokerPath < brokerPath.size(); ++ibrokerPath ) {
-        delete brokerPath[ibrokerPath];
-    }
-    for( size_t icluster = 0; icluster < cluster.size(); ++icluster ) {
-        delete cluster[icluster];
-    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 Message* Message::cloneDataStructure() const {
-    Message* message = new Message();
+    std::auto_ptr<Message> message( new Message() );
 
     // Copy the data from the base class or classes
     message->copyDataStructure( this );
 
-    return message;
+    return message.release();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -113,85 +89,33 @@
             __FILE__, __LINE__,
             "Message::copyDataStructure - src is NULL or invalid" );
     }
-    if( srcPtr->getProducerId() != NULL ) {
-        this->setProducerId(
-            dynamic_cast<ProducerId*>(
-                srcPtr->getProducerId()->cloneDataStructure() ) );
-    }
-    if( srcPtr->getDestination() != NULL ) {
-        this->setDestination(
-            dynamic_cast<ActiveMQDestination*>(
-                srcPtr->getDestination()->cloneDataStructure() ) );
-    }
-    if( srcPtr->getTransactionId() != NULL ) {
-        this->setTransactionId(
-            dynamic_cast<TransactionId*>(
-                srcPtr->getTransactionId()->cloneDataStructure() ) );
-    }
-    if( srcPtr->getOriginalDestination() != NULL ) {
-        this->setOriginalDestination(
-            dynamic_cast<ActiveMQDestination*>(
-                srcPtr->getOriginalDestination()->cloneDataStructure() ) );
-    }
-    if( srcPtr->getMessageId() != NULL ) {
-        this->setMessageId(
-            dynamic_cast<MessageId*>(
-                srcPtr->getMessageId()->cloneDataStructure() ) );
-    }
-    if( srcPtr->getOriginalTransactionId() != NULL ) {
-        this->setOriginalTransactionId(
-            dynamic_cast<TransactionId*>(
-                srcPtr->getOriginalTransactionId()->cloneDataStructure() ) );
-    }
+    this->setProducerId( srcPtr->getProducerId() );
+    this->setDestination( srcPtr->getDestination() );
+    this->setTransactionId( srcPtr->getTransactionId() );
+    this->setOriginalDestination( srcPtr->getOriginalDestination() );
+    this->setMessageId( srcPtr->getMessageId() );
+    this->setOriginalTransactionId( srcPtr->getOriginalTransactionId() );
     this->setGroupID( srcPtr->getGroupID() );
     this->setGroupSequence( srcPtr->getGroupSequence() );
     this->setCorrelationId( srcPtr->getCorrelationId() );
     this->setPersistent( srcPtr->isPersistent() );
     this->setExpiration( srcPtr->getExpiration() );
     this->setPriority( srcPtr->getPriority() );
-    if( srcPtr->getReplyTo() != NULL ) {
-        this->setReplyTo(
-            dynamic_cast<ActiveMQDestination*>(
-                srcPtr->getReplyTo()->cloneDataStructure() ) );
-    }
+    this->setReplyTo( srcPtr->getReplyTo() );
     this->setTimestamp( srcPtr->getTimestamp() );
     this->setType( srcPtr->getType() );
     this->setContent( srcPtr->getContent() );
     this->setMarshalledProperties( srcPtr->getMarshalledProperties() );
-    if( srcPtr->getDataStructure() != NULL ) {
-        this->setDataStructure(
-            dynamic_cast<DataStructure*>(
-                srcPtr->getDataStructure()->cloneDataStructure() ) );
-    }
-    if( srcPtr->getTargetConsumerId() != NULL ) {
-        this->setTargetConsumerId(
-            dynamic_cast<ConsumerId*>(
-                srcPtr->getTargetConsumerId()->cloneDataStructure() ) );
-    }
+    this->setDataStructure( srcPtr->getDataStructure() );
+    this->setTargetConsumerId( srcPtr->getTargetConsumerId() );
     this->setCompressed( srcPtr->isCompressed() );
     this->setRedeliveryCounter( srcPtr->getRedeliveryCounter() );
-    for( size_t ibrokerPath = 0; ibrokerPath < srcPtr->getBrokerPath().size(); ++ibrokerPath ) {
-        if( srcPtr->getBrokerPath()[ibrokerPath] != NULL ) {
-            this->getBrokerPath().push_back(
-                dynamic_cast<BrokerId*>(
-                    srcPtr->getBrokerPath()[ibrokerPath]->cloneDataStructure() ) );
-        } else {
-            this->getBrokerPath().push_back( NULL );
-        }
-    }
+    this->setBrokerPath( srcPtr->getBrokerPath() );
     this->setArrival( srcPtr->getArrival() );
     this->setUserID( srcPtr->getUserID() );
     this->setRecievedByDFBridge( srcPtr->isRecievedByDFBridge() );
     this->setDroppable( srcPtr->isDroppable() );
-    for( size_t icluster = 0; icluster < srcPtr->getCluster().size(); ++icluster ) {
-        if( srcPtr->getCluster()[icluster] != NULL ) {
-            this->getCluster().push_back(
-                dynamic_cast<BrokerId*>(
-                    srcPtr->getCluster()[icluster]->cloneDataStructure() ) );
-        } else {
-            this->getCluster().push_back( NULL );
-        }
-    }
+    this->setCluster( srcPtr->getCluster() );
     this->setBrokerInTime( srcPtr->getBrokerInTime() );
     this->setBrokerOutTime( srcPtr->getBrokerOutTime() );
 }
@@ -319,42 +243,42 @@
         return false;
     }
     if( this->getProducerId() != NULL ) {
-        if( !this->getProducerId()->equals( valuePtr->getProducerId() ) ) {
+        if( !this->getProducerId()->equals( valuePtr->getProducerId().get() ) ) {
             return false;
         }
     } else if( valuePtr->getProducerId() != NULL ) {
         return false;
     }
     if( this->getDestination() != NULL ) {
-        if( !this->getDestination()->equals( valuePtr->getDestination() ) ) {
+        if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) {
             return false;
         }
     } else if( valuePtr->getDestination() != NULL ) {
         return false;
     }
     if( this->getTransactionId() != NULL ) {
-        if( !this->getTransactionId()->equals( valuePtr->getTransactionId() ) ) {
+        if( !this->getTransactionId()->equals( valuePtr->getTransactionId().get() ) ) {
             return false;
         }
     } else if( valuePtr->getTransactionId() != NULL ) {
         return false;
     }
     if( this->getOriginalDestination() != NULL ) {
-        if( !this->getOriginalDestination()->equals( valuePtr->getOriginalDestination() ) ) {
+        if( !this->getOriginalDestination()->equals( valuePtr->getOriginalDestination().get() ) ) {
             return false;
         }
     } else if( valuePtr->getOriginalDestination() != NULL ) {
         return false;
     }
     if( this->getMessageId() != NULL ) {
-        if( !this->getMessageId()->equals( valuePtr->getMessageId() ) ) {
+        if( !this->getMessageId()->equals( valuePtr->getMessageId().get() ) ) {
             return false;
         }
     } else if( valuePtr->getMessageId() != NULL ) {
         return false;
     }
     if( this->getOriginalTransactionId() != NULL ) {
-        if( !this->getOriginalTransactionId()->equals( valuePtr->getOriginalTransactionId() ) ) {
+        if( !this->getOriginalTransactionId()->equals( valuePtr->getOriginalTransactionId().get() ) ) {
             return false;
         }
     } else if( valuePtr->getOriginalTransactionId() != NULL ) {
@@ -379,7 +303,7 @@
         return false;
     }
     if( this->getReplyTo() != NULL ) {
-        if( !this->getReplyTo()->equals( valuePtr->getReplyTo() ) ) {
+        if( !this->getReplyTo()->equals( valuePtr->getReplyTo().get() ) ) {
             return false;
         }
     } else if( valuePtr->getReplyTo() != NULL ) {
@@ -402,14 +326,14 @@
         }
     }
     if( this->getDataStructure() != NULL ) {
-        if( !this->getDataStructure()->equals( valuePtr->getDataStructure() ) ) {
+        if( !this->getDataStructure()->equals( valuePtr->getDataStructure().get() ) ) {
             return false;
         }
     } else if( valuePtr->getDataStructure() != NULL ) {
         return false;
     }
     if( this->getTargetConsumerId() != NULL ) {
-        if( !this->getTargetConsumerId()->equals( valuePtr->getTargetConsumerId() ) ) {
+        if( !this->getTargetConsumerId()->equals( valuePtr->getTargetConsumerId().get() ) ) {
             return false;
         }
     } else if( valuePtr->getTargetConsumerId() != NULL ) {
@@ -423,7 +347,7 @@
     }
     for( size_t ibrokerPath = 0; ibrokerPath < this->getBrokerPath().size(); ++ibrokerPath ) {
         if( this->getBrokerPath()[ibrokerPath] != NULL ) {
-            if( !this->getBrokerPath()[ibrokerPath]->equals( valuePtr->getBrokerPath()[ibrokerPath] ) ) {
+            if( !this->getBrokerPath()[ibrokerPath]->equals( valuePtr->getBrokerPath()[ibrokerPath].get() ) ) {
                 return false;
             }
         } else if( valuePtr->getBrokerPath()[ibrokerPath] != NULL ) {
@@ -444,7 +368,7 @@
     }
     for( size_t icluster = 0; icluster < this->getCluster().size(); ++icluster ) {
         if( this->getCluster()[icluster] != NULL ) {
-            if( !this->getCluster()[icluster]->equals( valuePtr->getCluster()[icluster] ) ) {
+            if( !this->getCluster()[icluster]->equals( valuePtr->getCluster()[icluster].get() ) ) {
                 return false;
             }
         } else if( valuePtr->getCluster()[icluster] != NULL ) {
@@ -475,99 +399,99 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-commands::Command* Message::visit( activemq::state::CommandVisitor* visitor ) 
+decaf::lang::Pointer<commands::Command> Message::visit( activemq::state::CommandVisitor* visitor ) 
     throw( exceptions::ActiveMQException ) {
 
     return visitor->processMessage( this );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const ProducerId* Message::getProducerId() const {
+const decaf::lang::Pointer<ProducerId>& Message::getProducerId() const {
     return producerId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ProducerId* Message::getProducerId() {
+decaf::lang::Pointer<ProducerId>& Message::getProducerId() {
     return producerId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Message::setProducerId( ProducerId* producerId ) {
+void Message::setProducerId( const decaf::lang::Pointer<ProducerId>& producerId ) {
     this->producerId = producerId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const ActiveMQDestination* Message::getDestination() const {
+const decaf::lang::Pointer<ActiveMQDestination>& Message::getDestination() const {
     return destination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ActiveMQDestination* Message::getDestination() {
+decaf::lang::Pointer<ActiveMQDestination>& Message::getDestination() {
     return destination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Message::setDestination( ActiveMQDestination* destination ) {
+void Message::setDestination( const decaf::lang::Pointer<ActiveMQDestination>& destination ) {
     this->destination = destination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const TransactionId* Message::getTransactionId() const {
+const decaf::lang::Pointer<TransactionId>& Message::getTransactionId() const {
     return transactionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-TransactionId* Message::getTransactionId() {
+decaf::lang::Pointer<TransactionId>& Message::getTransactionId() {
     return transactionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Message::setTransactionId( TransactionId* transactionId ) {
+void Message::setTransactionId( const decaf::lang::Pointer<TransactionId>& transactionId ) {
     this->transactionId = transactionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const ActiveMQDestination* Message::getOriginalDestination() const {
+const decaf::lang::Pointer<ActiveMQDestination>& Message::getOriginalDestination() const {
     return originalDestination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ActiveMQDestination* Message::getOriginalDestination() {
+decaf::lang::Pointer<ActiveMQDestination>& Message::getOriginalDestination() {
     return originalDestination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Message::setOriginalDestination( ActiveMQDestination* originalDestination ) {
+void Message::setOriginalDestination( const decaf::lang::Pointer<ActiveMQDestination>& originalDestination ) {
     this->originalDestination = originalDestination;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const MessageId* Message::getMessageId() const {
+const decaf::lang::Pointer<MessageId>& Message::getMessageId() const {
     return messageId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-MessageId* Message::getMessageId() {
+decaf::lang::Pointer<MessageId>& Message::getMessageId() {
     return messageId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Message::setMessageId( MessageId* messageId ) {
+void Message::setMessageId( const decaf::lang::Pointer<MessageId>& messageId ) {
     this->messageId = messageId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const TransactionId* Message::getOriginalTransactionId() const {
+const decaf::lang::Pointer<TransactionId>& Message::getOriginalTransactionId() const {
     return originalTransactionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-TransactionId* Message::getOriginalTransactionId() {
+decaf::lang::Pointer<TransactionId>& Message::getOriginalTransactionId() {
     return originalTransactionId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Message::setOriginalTransactionId( TransactionId* originalTransactionId ) {
+void Message::setOriginalTransactionId( const decaf::lang::Pointer<TransactionId>& originalTransactionId ) {
     this->originalTransactionId = originalTransactionId;
 }
 
@@ -642,17 +566,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const ActiveMQDestination* Message::getReplyTo() const {
+const decaf::lang::Pointer<ActiveMQDestination>& Message::getReplyTo() const {
     return replyTo;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ActiveMQDestination* Message::getReplyTo() {
+decaf::lang::Pointer<ActiveMQDestination>& Message::getReplyTo() {
     return replyTo;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Message::setReplyTo( ActiveMQDestination* replyTo ) {
+void Message::setReplyTo( const decaf::lang::Pointer<ActiveMQDestination>& replyTo ) {
     this->replyTo = replyTo;
 }
 
@@ -712,32 +636,32 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const DataStructure* Message::getDataStructure() const {
+const decaf::lang::Pointer<DataStructure>& Message::getDataStructure() const {
     return dataStructure;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-DataStructure* Message::getDataStructure() {
+decaf::lang::Pointer<DataStructure>& Message::getDataStructure() {
     return dataStructure;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Message::setDataStructure( DataStructure* dataStructure ) {
+void Message::setDataStructure( const decaf::lang::Pointer<DataStructure>& dataStructure ) {
     this->dataStructure = dataStructure;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const ConsumerId* Message::getTargetConsumerId() const {
+const decaf::lang::Pointer<ConsumerId>& Message::getTargetConsumerId() const {
     return targetConsumerId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ConsumerId* Message::getTargetConsumerId() {
+decaf::lang::Pointer<ConsumerId>& Message::getTargetConsumerId() {
     return targetConsumerId;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Message::setTargetConsumerId( ConsumerId* targetConsumerId ) {
+void Message::setTargetConsumerId( const decaf::lang::Pointer<ConsumerId>& targetConsumerId ) {
     this->targetConsumerId = targetConsumerId;
 }
 
@@ -762,17 +686,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const std::vector<BrokerId*>& Message::getBrokerPath() const {
+const std::vector< decaf::lang::Pointer<BrokerId> >& Message::getBrokerPath() const {
     return brokerPath;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<BrokerId*>& Message::getBrokerPath() {
+std::vector< decaf::lang::Pointer<BrokerId> >& Message::getBrokerPath() {
     return brokerPath;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Message::setBrokerPath( const std::vector<BrokerId*>& brokerPath ) {
+void Message::setBrokerPath( const std::vector< decaf::lang::Pointer<BrokerId> >& brokerPath ) {
     this->brokerPath = brokerPath;
 }
 
@@ -822,17 +746,17 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const std::vector<BrokerId*>& Message::getCluster() const {
+const std::vector< decaf::lang::Pointer<BrokerId> >& Message::getCluster() const {
     return cluster;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<BrokerId*>& Message::getCluster() {
+std::vector< decaf::lang::Pointer<BrokerId> >& Message::getCluster() {
     return cluster;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Message::setCluster( const std::vector<BrokerId*>& cluster ) {
+void Message::setCluster( const std::vector< decaf::lang::Pointer<BrokerId> >& cluster ) {
     this->cluster = cluster;
 }