activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1463777 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands: MessageAck.cpp MessageAck.h MessageDispatch.cpp MessageDispatch.h MessageId.cpp
Date Tue, 02 Apr 2013 22:34:15 GMT
Author: tabish
Date: Tue Apr  2 22:34:15 2013
New Revision: 1463777

URL: http://svn.apache.org/r1463777
Log:
Add fields for carrying poison ack cause and some utility constructors.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageAck.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageAck.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageDispatch.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageDispatch.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageId.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageAck.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageAck.cpp?rev=1463777&r1=1463776&r2=1463777&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageAck.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageAck.cpp Tue
Apr  2 22:34:15 2013
@@ -45,6 +45,29 @@ MessageAck::MessageAck() :
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+MessageAck::MessageAck(const Pointer<Message>& message, int ackType, int messageCount)
:
+    BaseCommand(), destination(NULL), transactionId(NULL), consumerId(NULL), ackType(0),
firstMessageId(NULL), lastMessageId(NULL), 
+      messageCount(0), poisonCause(NULL) {
+
+    this->ackType = (unsigned char)ackType;
+    this->destination = message->getDestination();
+    this->lastMessageId = message->getMessageId();
+    this->messageCount = messageCount;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageAck::MessageAck(const Pointer<MessageDispatch>& dispatch, int ackType, int
messageCount) :
+    BaseCommand(), destination(NULL), transactionId(NULL), consumerId(NULL), ackType(0),
firstMessageId(NULL), lastMessageId(NULL), 
+      messageCount(0), poisonCause(NULL) {
+
+    this->ackType = (unsigned char)ackType;
+    this->consumerId = dispatch->getConsumerId();
+    this->destination = dispatch->getDestination();
+    this->lastMessageId = dispatch->getMessage()->getMessageId();
+    this->messageCount = messageCount;
+}
+
+////////////////////////////////////////////////////////////////////////////////
 MessageAck::~MessageAck() {
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageAck.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageAck.h?rev=1463777&r1=1463776&r2=1463777&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageAck.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageAck.h Tue Apr
 2 22:34:15 2013
@@ -27,6 +27,8 @@
 #include <activemq/commands/BaseCommand.h>
 #include <activemq/commands/BrokerError.h>
 #include <activemq/commands/ConsumerId.h>
+#include <activemq/commands/Message.h>
+#include <activemq/commands/MessageDispatch.h>
 #include <activemq/commands/MessageId.h>
 #include <activemq/commands/TransactionId.h>
 #include <activemq/util/Config.h>
@@ -73,6 +75,10 @@ namespace commands {
 
         MessageAck();
 
+        MessageAck(const Pointer<Message>& message, int ackType, int messageCount);
+
+        MessageAck(const Pointer<MessageDispatch>& dispatch, int ackType, int messageCount);
+
         virtual ~MessageAck();
 
         virtual unsigned char getDataStructureType() const;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageDispatch.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageDispatch.cpp?rev=1463777&r1=1463776&r2=1463777&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageDispatch.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageDispatch.cpp
Tue Apr  2 22:34:15 2013
@@ -39,7 +39,7 @@ using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 MessageDispatch::MessageDispatch() :
-    BaseCommand(), consumerId(NULL), destination(NULL), message(NULL), redeliveryCounter(0)
{
+    BaseCommand(), consumerId(NULL), destination(NULL), message(NULL), redeliveryCounter(0),
rollbackCause() {
 
 }
 
@@ -225,3 +225,13 @@ void MessageDispatch::setRedeliveryCount
 decaf::lang::Pointer<commands::Command> MessageDispatch::visit(activemq::state::CommandVisitor*
visitor) {
     return visitor->processMessageDispatch(this);
 }
+////////////////////////////////////////////////////////////////////////////////
+void MessageDispatch::setRollbackCause(const decaf::lang::Exception& cause) {
+    this->rollbackCause = cause;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+decaf::lang::Exception MessageDispatch::getRollbackCause() const {
+    return this->rollbackCause;
+}
+

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageDispatch.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageDispatch.h?rev=1463777&r1=1463776&r2=1463777&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageDispatch.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessageDispatch.h
Tue Apr  2 22:34:15 2013
@@ -28,6 +28,7 @@
 #include <activemq/commands/ConsumerId.h>
 #include <activemq/commands/Message.h>
 #include <activemq/util/Config.h>
+#include <decaf/lang/Exception.h>
 #include <decaf/lang/Pointer.h>
 #include <string>
 #include <vector>
@@ -60,6 +61,10 @@ namespace commands {
 
     private:
 
+        decaf::lang::Exception rollbackCause;
+
+    private:
+
         MessageDispatch(const MessageDispatch&);
         MessageDispatch& operator= (const MessageDispatch&);
 
@@ -79,6 +84,10 @@ namespace commands {
 
         virtual bool equals(const DataStructure* value) const;
 
+        void setRollbackCause(const decaf::lang::Exception& cause);
+
+        decaf::lang::Exception getRollbackCause() const;
+
         virtual const Pointer<ConsumerId>& getConsumerId() const;
         virtual Pointer<ConsumerId>& getConsumerId();
         virtual void setConsumerId( const Pointer<ConsumerId>& consumerId );

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=1463777&r1=1463776&r2=1463777&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
Apr  2 22:34:15 2013
@@ -135,8 +135,8 @@ std::string MessageId::toString() const 
 
     if( key == "" ) {
         this->key = this->producerId->toString() + ":" + 
-                    Long::toString( this->producerSequenceId) + ":" + 
-                    Long::toString( this->brokerSequenceId);
+                    Long::toString(this->producerSequenceId) + ":" + 
+                    Long::toString(this->brokerSequenceId);
     }
 
     return this->key;



Mime
View raw message