activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1035852 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/
Date Tue, 16 Nov 2010 22:59:14 GMT
Author: tabish
Date: Tue Nov 16 22:59:14 2010
New Revision: 1035852

URL: http://svn.apache.org/viewvc?rev=1035852&view=rev
Log:
Regenerated Commands with full implementation of XATransaction as an cms::Xid.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/BrokerId.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionId.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConsumerId.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/LocalTransactionId.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageId.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageId.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerId.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionId.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionId.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionInfo.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionInfo.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/TransactionId.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/XATransactionId.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/XATransactionId.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/BrokerId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/BrokerId.cpp?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/BrokerId.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/BrokerId.cpp Tue Nov
16 22:59:14 2010
@@ -152,7 +152,7 @@ int BrokerId::compareTo( const BrokerId&
 
 ////////////////////////////////////////////////////////////////////////////////
 bool BrokerId::equals( const BrokerId& value ) const {
-    return this->equals( &value );
+    return this->equals( (const DataStructure*)&value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionId.cpp?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionId.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionId.cpp Tue
Nov 16 22:59:14 2010
@@ -176,7 +176,7 @@ int ConnectionId::compareTo( const Conne
 
 ////////////////////////////////////////////////////////////////////////////////
 bool ConnectionId::equals( const ConnectionId& value ) const {
-    return this->equals( &value );
+    return this->equals( (const DataStructure*)&value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConsumerId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConsumerId.cpp?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConsumerId.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConsumerId.cpp Tue
Nov 16 22:59:14 2010
@@ -41,20 +41,20 @@ using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 ConsumerId::ConsumerId() 
-    : BaseDataStructure(), parentId(), connectionId(""), sessionId(0), value(0) {
+    : BaseDataStructure(), connectionId(""), sessionId(0), value(0) {
 
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 ConsumerId::ConsumerId( const ConsumerId& other )
-    : BaseDataStructure(), parentId(), connectionId(""), sessionId(0), value(0) {
+    : BaseDataStructure(), connectionId(""), sessionId(0), value(0) {
 
     this->copyDataStructure( &other );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 ConsumerId::ConsumerId( const SessionId& sessionId, long long consumerIdd )
-    : BaseDataStructure(), parentId(), connectionId(""), sessionId(0), value(0) {
+    : BaseDataStructure(), connectionId(""), sessionId(0), value(0) {
 
     this->connectionId = sessionId.getConnectionId();
     this->sessionId = sessionId.getValue();
@@ -208,7 +208,7 @@ int ConsumerId::compareTo( const Consume
 
 ////////////////////////////////////////////////////////////////////////////////
 bool ConsumerId::equals( const ConsumerId& value ) const {
-    return this->equals( &value );
+    return this->equals( (const DataStructure*)&value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/LocalTransactionId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/LocalTransactionId.cpp?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/LocalTransactionId.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/LocalTransactionId.cpp
Tue Nov 16 22:59:14 2010
@@ -189,7 +189,7 @@ int LocalTransactionId::compareTo( const
 
 ////////////////////////////////////////////////////////////////////////////////
 bool LocalTransactionId::equals( const LocalTransactionId& value ) const {
-    return this->equals( &value );
+    return this->equals( (const DataStructure*)&value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.cpp Tue Nov
16 22:59:14 2010
@@ -44,11 +44,10 @@ using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 Message::Message() 
-    : BaseCommand(), ackHandler(NULL), properties(), readOnlyProperties(false), readOnlyBody(false),
connection(NULL), producerId(NULL), 
-      destination(NULL), transactionId(NULL), originalDestination(NULL), messageId(NULL),
originalTransactionId(NULL), 
+    : BaseCommand(), producerId(NULL), destination(NULL), transactionId(NULL), originalDestination(NULL),
messageId(NULL), originalTransactionId(NULL), 
       groupID(""), groupSequence(0), correlationId(""), persistent(false), expiration(0),
priority(0), replyTo(NULL), timestamp(0), 
       type(""), content(), marshalledProperties(), dataStructure(NULL), targetConsumerId(NULL),
compressed(false), redeliveryCounter(0), 
-      brokerPath(), arrival(0), userID(""), recievedByDFBridge(false), droppable(false),
cluster(), brokerInTime(0), brokerOutTime(0) {
+      brokerPath(), arrival(0), userID(""), recievedByDFBridge(false), droppable(false),
cluster(), brokerInTime(0), brokerOutTime(0), ackHandler(NULL), properties(), readOnlyProperties(false),
readOnlyBody(false), connection(NULL) {
 
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.h?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Message.h Tue Nov
16 22:59:14 2010
@@ -57,28 +57,6 @@ namespace commands{
      *
      */
     class AMQCPP_API Message : public BaseCommand {
-    private:
-
-        // Used to allow a client to call Message::acknowledge when in the Client
-        // Ack mode.
-        Pointer<core::ActiveMQAckHandler> ackHandler;
-
-        // Message properties, these are Marshaled and Unmarshaled from the Message
-        // Command's marshaledProperties vector.
-        activemq::util::PrimitiveMap properties;
-
-        // Indicates if the Message Properties are Read Only
-        bool readOnlyProperties;
-
-        // Indicates if the Message Body are Read Only
-        bool readOnlyBody;
-
-    protected:
-
-        core::ActiveMQConnection* connection;
-
-        static const unsigned int DEFAULT_MESSAGE_SIZE = 1024;
-
     protected:
 
         Pointer<ProducerId> producerId;
@@ -117,6 +95,28 @@ namespace commands{
 
     private:
 
+        // Used to allow a client to call Message::acknowledge when in the Client
+        // Ack mode.
+        Pointer<core::ActiveMQAckHandler> ackHandler;
+
+        // Message properties, these are Marshaled and Unmarshaled from the Message
+        // Command's marshaledProperties vector.
+        activemq::util::PrimitiveMap properties;
+
+        // Indicates if the Message Properties are Read Only
+        bool readOnlyProperties;
+
+        // Indicates if the Message Body are Read Only
+        bool readOnlyBody;
+
+    protected:
+
+        core::ActiveMQConnection* connection;
+
+        static const unsigned int DEFAULT_MESSAGE_SIZE = 1024;
+
+    private:
+
         Message( const Message& );
         Message& operator= ( const Message& );
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageId.cpp?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageId.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageId.cpp Tue
Nov 16 22:59:14 2010
@@ -42,27 +42,27 @@ using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 MessageId::MessageId() 
-    : BaseDataStructure(), key(""), producerId(NULL), producerSequenceId(0), brokerSequenceId(0)
{
+    : BaseDataStructure(), producerId(NULL), producerSequenceId(0), brokerSequenceId(0),
key("") {
 
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 MessageId::MessageId( const MessageId& other )
-    : BaseDataStructure(), key(""), producerId(NULL), producerSequenceId(0), brokerSequenceId(0)
{
+    : BaseDataStructure(), producerId(NULL), producerSequenceId(0), brokerSequenceId(0),
key("") {
 
     this->copyDataStructure( &other );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 MessageId::MessageId( const std::string& messageKey )
-    : BaseDataStructure(), key(""), producerId(NULL), producerSequenceId(0), brokerSequenceId(0)
{
+    : BaseDataStructure(), producerId(NULL), producerSequenceId(0), brokerSequenceId(0),
key("") {
 
     this->setValue( messageKey );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 MessageId::MessageId( const Pointer<ProducerInfo>& producerInfo, long long producerSequenceId
)
-    : BaseDataStructure(), key(""), producerId(NULL), producerSequenceId(0), brokerSequenceId(0)
{
+    : BaseDataStructure(), producerId(NULL), producerSequenceId(0), brokerSequenceId(0),
key("") {
 
     this->producerId = producerInfo->getProducerId();
     this->producerSequenceId = producerSequenceId;
@@ -70,7 +70,7 @@ MessageId::MessageId( const Pointer<Prod
 
 ////////////////////////////////////////////////////////////////////////////////
 MessageId::MessageId( const Pointer<ProducerId>& producerId, long long producerSequenceId
)
-    : BaseDataStructure(), key(""), producerId(NULL), producerSequenceId(0), brokerSequenceId(0)
{
+    : BaseDataStructure(), producerId(NULL), producerSequenceId(0), brokerSequenceId(0),
key("") {
 
     this->producerId = producerId;
     this->producerSequenceId = producerSequenceId;
@@ -78,7 +78,7 @@ MessageId::MessageId( const Pointer<Prod
 
 ////////////////////////////////////////////////////////////////////////////////
 MessageId::MessageId( const std::string& producerId, long long producerSequenceId )
-    : BaseDataStructure(), key(""), producerId(NULL), producerSequenceId(0), brokerSequenceId(0)
{
+    : BaseDataStructure(), producerId(NULL), producerSequenceId(0), brokerSequenceId(0),
key("") {
 
     this->producerId.reset( new ProducerId( producerId ) );
     this->producerSequenceId = producerSequenceId;
@@ -236,7 +236,7 @@ int MessageId::compareTo( const MessageI
 
 ////////////////////////////////////////////////////////////////////////////////
 bool MessageId::equals( const MessageId& value ) const {
-    return this->equals( &value );
+    return this->equals( (const DataStructure*)&value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageId.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageId.h?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageId.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageId.h Tue Nov
16 22:59:14 2010
@@ -47,10 +47,6 @@ namespace commands{
      *
      */
     class AMQCPP_API MessageId : public BaseDataStructure, public decaf::lang::Comparable<MessageId>
{
-    private:
-
-        mutable std::string key;
-
     protected:
 
         Pointer<ProducerId> producerId;
@@ -63,6 +59,10 @@ namespace commands{
 
         typedef decaf::lang::PointerComparator<MessageId> COMPARATOR;
 
+    private:
+
+        mutable std::string key;
+
     public:
 
         MessageId();

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerId.cpp?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerId.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerId.cpp Tue
Nov 16 22:59:14 2010
@@ -42,20 +42,20 @@ using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 ProducerId::ProducerId() 
-    : BaseDataStructure(), parentId(), connectionId(""), value(0), sessionId(0) {
+    : BaseDataStructure(), connectionId(""), value(0), sessionId(0) {
 
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 ProducerId::ProducerId( const ProducerId& other )
-    : BaseDataStructure(), parentId(), connectionId(""), value(0), sessionId(0) {
+    : BaseDataStructure(), connectionId(""), value(0), sessionId(0) {
 
     this->copyDataStructure( &other );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 ProducerId::ProducerId( const SessionId& sessionId, long long consumerId )
-    : BaseDataStructure(), parentId(), connectionId(""), value(0), sessionId(0) {
+    : BaseDataStructure(), connectionId(""), value(0), sessionId(0) {
 
     this->connectionId = sessionId.getConnectionId();
     this->sessionId = sessionId.getValue();
@@ -64,7 +64,7 @@ ProducerId::ProducerId( const SessionId&
 
 ////////////////////////////////////////////////////////////////////////////////
 ProducerId::ProducerId( std::string producerKey )
-    : BaseDataStructure(), parentId(), connectionId(""), value(0), sessionId(0) {
+    : BaseDataStructure(), connectionId(""), value(0), sessionId(0) {
 
     // Parse off the producerId
     std::size_t p = producerKey.rfind( ':' );
@@ -224,7 +224,7 @@ int ProducerId::compareTo( const Produce
 
 ////////////////////////////////////////////////////////////////////////////////
 bool ProducerId::equals( const ProducerId& value ) const {
-    return this->equals( &value );
+    return this->equals( (const DataStructure*)&value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionId.cpp?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionId.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionId.cpp Tue
Nov 16 22:59:14 2010
@@ -44,20 +44,20 @@ using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 SessionId::SessionId() 
-    : BaseDataStructure(), parentId(), connectionId(""), value(0) {
+    : BaseDataStructure(), connectionId(""), value(0), parentId() {
 
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 SessionId::SessionId( const SessionId& other )
-    : BaseDataStructure(), parentId(), connectionId(""), value(0) {
+    : BaseDataStructure(), connectionId(""), value(0), parentId() {
 
     this->copyDataStructure( &other );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 SessionId::SessionId( const ConnectionId* connectionId, long long sessionId )
-    : BaseDataStructure(), parentId(), connectionId(""), value(0) {
+    : BaseDataStructure(), connectionId(""), value(0), parentId() {
 
     this->connectionId = connectionId->getValue();
     this->value = sessionId;
@@ -65,7 +65,7 @@ SessionId::SessionId( const ConnectionId
 
 ////////////////////////////////////////////////////////////////////////////////
 SessionId::SessionId( const ProducerId* producerId )
-    : BaseDataStructure(), parentId(), connectionId(""), value(0) {
+    : BaseDataStructure(), connectionId(""), value(0), parentId() {
 
     this->connectionId = producerId->getConnectionId();
     this->value = producerId->getSessionId();
@@ -73,7 +73,7 @@ SessionId::SessionId( const ProducerId* 
 
 ////////////////////////////////////////////////////////////////////////////////
 SessionId::SessionId( const ConsumerId* consumerId )
-    : BaseDataStructure(), parentId(), connectionId(""), value(0) {
+    : BaseDataStructure(), connectionId(""), value(0), parentId() {
 
     this->connectionId = consumerId->getConnectionId();
     this->value = consumerId->getSessionId();
@@ -204,7 +204,7 @@ int SessionId::compareTo( const SessionI
 
 ////////////////////////////////////////////////////////////////////////////////
 bool SessionId::equals( const SessionId& value ) const {
-    return this->equals( &value );
+    return this->equals( (const DataStructure*)&value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionId.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionId.h?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionId.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionId.h Tue Nov
16 22:59:14 2010
@@ -49,10 +49,6 @@ namespace commands{
      *
      */
     class AMQCPP_API SessionId : public BaseDataStructure, public decaf::lang::Comparable<SessionId>
{
-    private:
-
-        mutable Pointer<ConnectionId> parentId;
-
     protected:
 
         std::string connectionId;
@@ -64,6 +60,10 @@ namespace commands{
 
         typedef decaf::lang::PointerComparator<SessionId> COMPARATOR;
 
+    private:
+
+        mutable Pointer<ConnectionId> parentId;
+
     public:
 
         SessionId();

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionInfo.cpp?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionInfo.cpp Tue
Nov 16 22:59:14 2010
@@ -40,7 +40,7 @@ using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 SessionInfo::SessionInfo() 
-    : BaseCommand(), ackMode((unsigned int)cms::Session::AUTO_ACKNOWLEDGE), sessionId(NULL)
{
+    : BaseCommand(), sessionId(NULL), ackMode((unsigned int)cms::Session::AUTO_ACKNOWLEDGE)
{
 
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionInfo.h?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionInfo.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SessionInfo.h Tue
Nov 16 22:59:14 2010
@@ -46,11 +46,6 @@ namespace commands{
      *
      */
     class AMQCPP_API SessionInfo : public BaseCommand {
-    private:
-
-        // The ACK mode that the Session was created with
-        unsigned int ackMode;
-
     protected:
 
         Pointer<SessionId> sessionId;
@@ -61,6 +56,11 @@ namespace commands{
 
     private:
 
+        // The ACK mode that the Session was created with
+        unsigned int ackMode;
+
+    private:
+
         SessionInfo( const SessionInfo& );
         SessionInfo& operator= ( const SessionInfo& );
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/TransactionId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/TransactionId.cpp?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/TransactionId.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/TransactionId.cpp
Tue Nov 16 22:59:14 2010
@@ -133,7 +133,7 @@ int TransactionId::compareTo( const Tran
 
 ////////////////////////////////////////////////////////////////////////////////
 bool TransactionId::equals( const TransactionId& value ) const {
-    return this->equals( &value );
+    return this->equals( (const DataStructure*)&value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/XATransactionId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/XATransactionId.cpp?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/XATransactionId.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/XATransactionId.cpp
Tue Nov 16 22:59:14 2010
@@ -19,6 +19,7 @@
 #include <activemq/exceptions/ActiveMQException.h>
 #include <activemq/state/CommandVisitor.h>
 #include <apr_strings.h>
+#include <cms/XAException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
 using namespace std;
@@ -40,18 +41,47 @@ using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 XATransactionId::XATransactionId() 
-    : TransactionId(), formatId(0), globalTransactionId(), branchQualifier() {
+    : TransactionId(), cms::Xid(), formatId(0), globalTransactionId(), branchQualifier()
{
 
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 XATransactionId::XATransactionId( const XATransactionId& other )
-    : TransactionId(), formatId(0), globalTransactionId(), branchQualifier() {
+    : TransactionId(), cms::Xid(), formatId(0), globalTransactionId(), branchQualifier()
{
 
     this->copyDataStructure( &other );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+XATransactionId::XATransactionId( const cms::Xid* xid )
+    : TransactionId(), cms::Xid(), formatId(0), globalTransactionId(), branchQualifier()
{
+
+    if( xid == NULL ) {
+        return;
+    }
+
+    this->formatId = xid->getFormatId();
+    this->branchQualifier.resize( cms::Xid::MAXBQUALSIZE );
+    this->globalTransactionId.resize( cms::Xid::MAXGTRIDSIZE );
+
+    int result = xid->getBranchQualifier( &this->branchQualifier[0], cms::Xid::MAXBQUALSIZE
);
+
+    if( result == -1 ) {
+        throw cms::XAException("Invalid Xid Branch Qualifier is larger than MAXBQUALSIZE"
);
+    } else {
+        this->branchQualifier.resize( result );
+    }
+
+    result = xid->getGlobalTransactionId( &this->globalTransactionId[0], cms::Xid::MAXGTRIDSIZE
);
+
+    if( result == -1 ) {
+        throw cms::XAException("Invalid Xid Global Transaction Id is larger than MAXGTRIDSIZE"
);
+    } else {
+        this->globalTransactionId.resize( result );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
 XATransactionId::~XATransactionId() {
 }
 
@@ -230,7 +260,7 @@ int XATransactionId::compareTo( const XA
 
 ////////////////////////////////////////////////////////////////////////////////
 bool XATransactionId::equals( const XATransactionId& value ) const {
-    return this->equals( &value );
+    return this->equals( (const DataStructure*)&value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -249,3 +279,89 @@ XATransactionId& XATransactionId::operat
     return *this;
 }
 
+////////////////////////////////////////////////////////////////////////////////
+cms::Xid* XATransactionId::clone() const {
+
+    XATransactionId* theClone = new XATransactionId();
+
+    theClone->formatId = this->formatId;
+    theClone->globalTransactionId = this->globalTransactionId;
+    theClone->branchQualifier = this->branchQualifier;
+
+    return theClone;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool XATransactionId::equals( const cms::Xid* other ) const {
+
+    if( (void*)this == other ) {
+        return true;
+    }
+
+    if( other == NULL ) {
+        return false;
+    }
+
+    if( this->formatId != other->getFormatId() ) {
+        return false;
+    }
+
+    std::vector<unsigned char> otherBQual( Xid::MAXBQUALSIZE );
+
+    other->getBranchQualifier( &otherBQual[0], Xid::MAXBQUALSIZE );
+
+    if( this->branchQualifier != otherBQual ) {
+        return false;
+    }
+
+    std::vector<unsigned char> otherGTXID( Xid::MAXBQUALSIZE );
+
+    other->getGlobalTransactionId( &otherGTXID[0], Xid::MAXGTRIDSIZE );
+
+    if( this->globalTransactionId != otherGTXID ) {
+        return false;
+    }
+
+    return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+int XATransactionId::getBranchQualifier( unsigned char* buffer, int size ) const {
+
+    if( size < 0 ) {
+        throw cms::XAException("Invalid negative size value passed to getBranchQualifier()");
+    }
+
+    if( size < (int)this->branchQualifier.size() ) {
+        return -1;
+    }
+
+    if( this->branchQualifier.size() == 0 ) {
+        return 0;
+    }
+
+    std::copy( this->branchQualifier.begin(), this->branchQualifier.end(), buffer );
+
+    return (int)this->branchQualifier.size();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+int XATransactionId::getGlobalTransactionId( unsigned char* buffer, int size ) const {
+
+    if( size < 0 ) {
+        throw cms::XAException("Invalid negative size value passed to getGlobalTransactionId()");
+    }
+
+    if( size < (int)this->globalTransactionId.size() ) {
+        return -1;
+    }
+
+    if( this->globalTransactionId.size() == 0 ) {
+        return 0;
+    }
+
+    std::copy( this->globalTransactionId.begin(), this->globalTransactionId.end(),
buffer );
+
+    return (int)this->globalTransactionId.size();
+}
+

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/XATransactionId.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/XATransactionId.h?rev=1035852&r1=1035851&r2=1035852&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/XATransactionId.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/XATransactionId.h
Tue Nov 16 22:59:14 2010
@@ -25,6 +25,7 @@
 
 #include <activemq/commands/TransactionId.h>
 #include <activemq/util/Config.h>
+#include <cms/Xid.h>
 #include <decaf/lang/Comparable.h>
 #include <decaf/lang/Pointer.h>
 #include <string>
@@ -44,7 +45,7 @@ namespace commands{
      *         in the activemq-cpp-openwire-generator module
      *
      */
-    class AMQCPP_API XATransactionId : public TransactionId, public decaf::lang::Comparable<XATransactionId>
{
+    class AMQCPP_API XATransactionId : public TransactionId, public cms::Xid, public decaf::lang::Comparable<XATransactionId>
{
     protected:
 
         int formatId;
@@ -63,6 +64,8 @@ namespace commands{
 
         XATransactionId( const XATransactionId& other );
 
+        XATransactionId( const cms::Xid* xid );
+
         virtual ~XATransactionId();
 
         virtual unsigned char getDataStructureType() const;
@@ -79,6 +82,16 @@ namespace commands{
             return true;
         }
 
+    public:  // Xid interface implementation.
+
+        virtual Xid* clone() const;
+
+        virtual bool equals( const Xid* other ) const;
+
+        virtual int getBranchQualifier( unsigned char* buffer, int size ) const;
+
+        virtual int getGlobalTransactionId( unsigned char* buffer, int size ) const;
+
         virtual int getFormatId() const;
         virtual void setFormatId( int formatId );
 



Mime
View raw message