activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r508085 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire: OpenWireProducerInfo.h OpenWireTransactionInfo.h
Date Thu, 15 Feb 2007 19:12:39 GMT
Author: tabish
Date: Thu Feb 15 11:12:39 2007
New Revision: 508085

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

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireProducerInfo.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireTransactionInfo.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireProducerInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireProducerInfo.h?view=diff&rev=508085&r1=508084&r2=508085
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireProducerInfo.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireProducerInfo.h
Thu Feb 15 11:12:39 2007
@@ -33,26 +33,16 @@
         // OpenWire ProducerInfo Command
         commands::ProducerInfo* producerInfo;
 
-        // Producer Id
-        unsigned int producerId;
-
-        // Default Destination
-        cms::Destination* destination;
-
         // Session that this producer is attached to - we do not own this
         const SessionInfo* session;
 
     public:
 
         OpenWireProducerInfo() {
-            destination = NULL;
-            producerId = 0;
             session = NULL;
         }
 
-        virtual ~OpenWireProducerInfo() {
-            delete destination;
-        }
+        virtual ~OpenWireProducerInfo() {}
 
         /**
          * Retrieves the default destination that this producer
@@ -60,7 +50,7 @@
          * @return Destionation, owned by this object
          */
         virtual const cms::Destination& getDestination(void) const {
-            return *destination;
+            //return *destination;
         }
 
         /**
@@ -68,7 +58,12 @@
          * @param destination reference to a destination, copied internally
          */
         virtual void setDestination( const cms::Destination& destination ) {
-            this->destination = destination.clone();
+            if( this->producerInfo != NULL ) {
+
+                this->producerInfo->setDestination(
+                    dynamic_cast<commands::ActiveMQDestination*>(
+                        destination.clone() ) );
+            }
         }
 
         /**
@@ -76,7 +71,12 @@
          * @return value of the Producer Id.
          */
         virtual unsigned int getProducerId(void) const {
-            return producerId;
+            if( this->producerInfo != NULL ) {
+                return (unsigned int)
+                    this->producerInfo->getProducerId()->getValue();
+            }
+
+            return 0;
         }
 
         /**
@@ -84,7 +84,9 @@
          * @return id string value of the Producer Id.
          */
         virtual void setProducerId( const unsigned int id ) {
-            this->producerId = id;
+            if( this->producerInfo != NULL ) {
+                this->producerInfo->getProducerId()->setValue( id );
+            }
         }
 
         /**

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireTransactionInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireTransactionInfo.h?view=diff&rev=508085&r1=508084&r2=508085
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireTransactionInfo.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireTransactionInfo.h
Thu Feb 15 11:12:39 2007
@@ -33,12 +33,12 @@
         // OpenWire Tramsaction Info Command
         commands::TransactionInfo* transactionInfo;
 
-        // Transaction Id
-        unsigned int transactionId;
-
         // Session Info - We do not own this
         const SessionInfo* session;
 
+        // Locally generated Transaction Id
+        unsigned int transactionId;
+
     public:
 
         OpenWireTransactionInfo() {
@@ -53,7 +53,7 @@
          * @return unsigned int Id
          */
         virtual unsigned int getTransactionId(void) const {
-            return transactionId;
+            return this->transactionId;
         }
 
         /**



Mime
View raw message