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/12/31 00:14:23 UTC
svn commit: r894734 [2/2] - in
/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq: commands/
transport/logging/
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=894734&r1=894733&r2=894734&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 Wed Dec 30 23:14:20 2009
@@ -19,7 +19,9 @@
#include <activemq/exceptions/ActiveMQException.h>
#include <activemq/state/CommandVisitor.h>
#include <apr_strings.h>
+#include <decaf/lang/Long.h>
#include <decaf/lang/exceptions/NullPointerException.h>
+#include <sstream>
using namespace std;
using namespace activemq;
@@ -51,6 +53,29 @@
}
////////////////////////////////////////////////////////////////////////////////
+MessageId::MessageId( const std::string& messageKey ) {
+ this->setValue( messageKey );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageId::MessageId( const Pointer<ProducerInfo>& producerInfo, long long producerSequenceId ) {
+ this->producerId = producerInfo->getProducerId();
+ this->producerSequenceId = producerSequenceId;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageId::MessageId( const Pointer<ProducerId>& producerId, long long producerSequenceId ) {
+ this->producerId = producerId;
+ this->producerSequenceId = producerSequenceId;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageId::MessageId( const std::string& producerId, long long producerSequenceId ) {
+ this->producerId.reset( new ProducerId( producerId ) );
+ this->producerSequenceId = producerSequenceId;
+}
+
+////////////////////////////////////////////////////////////////////////////////
MessageId::~MessageId() {
}
@@ -96,22 +121,14 @@
////////////////////////////////////////////////////////////////////////////////
std::string MessageId::toString() const {
- ostringstream stream;
- stream << "Begin Class = MessageId" << std::endl;
- stream << " Value of MessageId::ID_MESSAGEID = 110" << std::endl;
- stream << " Value of ProducerId is Below:" << std::endl;
- if( this->getProducerId() != NULL ) {
- stream << this->getProducerId()->toString() << std::endl;
- } else {
- stream << " Object is NULL" << std::endl;
- }
- stream << " Value of ProducerSequenceId = " << this->getProducerSequenceId() << std::endl;
- stream << " Value of BrokerSequenceId = " << this->getBrokerSequenceId() << std::endl;
- stream << BaseDataStructure::toString();
- stream << "End Class = MessageId" << std::endl;
+ if( key == "" ) {
+ this->key = this->producerId->toString() + ":" +
+ Long::toString( this->producerSequenceId ) + ":" +
+ Long::toString( this->brokerSequenceId );
+ }
- return stream.str();
+ return this->key;
}
////////////////////////////////////////////////////////////////////////////////
@@ -229,3 +246,25 @@
return *this;
}
+////////////////////////////////////////////////////////////////////////////////
+void MessageId::setValue( const std::string& key ) {
+
+ std::string messageKey = key;
+
+ // Parse off the sequenceId
+ std::size_t p = messageKey.rfind( ':' );
+
+ if( p != std::string::npos ) {
+ producerSequenceId = Long::parseLong( messageKey.substr( p + 1, std::string::npos ) );
+ messageKey = messageKey.substr( 0, p );
+ }
+
+ this->producerId.reset( new ProducerId( messageKey ) );
+ this->key = messageKey;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void MessageId::setTextView( const std::string& key ) {
+ this->key = key;
+}
+
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=894734&r1=894733&r2=894734&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 Wed Dec 30 23:14:20 2009
@@ -25,6 +25,7 @@
#include <activemq/commands/BaseDataStructure.h>
#include <activemq/commands/ProducerId.h>
+#include <activemq/commands/ProducerInfo.h>
#include <activemq/util/Config.h>
#include <decaf/lang/Comparable.h>
#include <decaf/lang/Pointer.h>
@@ -46,6 +47,10 @@
*
*/
class AMQCPP_API MessageId : public BaseDataStructure, public decaf::lang::Comparable<MessageId> {
+ private:
+
+ mutable std::string key;
+
protected:
Pointer<ProducerId> producerId;
@@ -64,6 +69,14 @@
MessageId( const MessageId& other );
+ MessageId( const std::string& messageKey );
+
+ MessageId( const Pointer<ProducerInfo>& producerInfo, long long producerSequenceId );
+
+ MessageId( const Pointer<ProducerId>& producerId, long long producerSequenceId );
+
+ MessageId( const std::string& producerId, long long producerSequenceId );
+
virtual ~MessageId();
/**
@@ -102,6 +115,10 @@
*/
virtual bool equals( const DataStructure* value ) const;
+ void setValue( const std::string& key );
+
+ void setTextView( const std::string& key );
+
virtual const Pointer<ProducerId>& getProducerId() const;
virtual Pointer<ProducerId>& getProducerId();
virtual void setProducerId( const Pointer<ProducerId>& producerId );
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessagePull.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessagePull.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessagePull.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/MessagePull.cpp Wed Dec 30 23:14:20 2009
@@ -94,30 +94,35 @@
ostringstream stream;
- stream << "Begin Class = MessagePull" << std::endl;
- stream << " Value of MessagePull::ID_MESSAGEPULL = 20" << std::endl;
- stream << " Value of ConsumerId is Below:" << std::endl;
+ stream << "MessagePull { "
+ << "commandId = " << this->getCommandId() << ", "
+ << "responseRequired = " << boolalpha << this->isResponseRequired();
+ stream << ", ";
+ stream << "ConsumerId = ";
if( this->getConsumerId() != NULL ) {
- stream << this->getConsumerId()->toString() << std::endl;
+ stream << this->getConsumerId()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << " Value of Destination is Below:" << std::endl;
+ stream << ", ";
+ stream << "Destination = ";
if( this->getDestination() != NULL ) {
- stream << this->getDestination()->toString() << std::endl;
+ stream << this->getDestination()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << " Value of Timeout = " << this->getTimeout() << std::endl;
- stream << " Value of CorrelationId = " << this->getCorrelationId() << std::endl;
- stream << " Value of MessageId is Below:" << std::endl;
+ stream << ", ";
+ stream << "Timeout = " << this->getTimeout();
+ stream << ", ";
+ stream << "CorrelationId = " << this->getCorrelationId();
+ stream << ", ";
+ stream << "MessageId = ";
if( this->getMessageId() != NULL ) {
- stream << this->getMessageId()->toString() << std::endl;
+ stream << this->getMessageId()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << BaseCommand::toString();
- stream << "End Class = MessagePull" << std::endl;
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/NetworkBridgeFilter.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/NetworkBridgeFilter.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/NetworkBridgeFilter.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/NetworkBridgeFilter.cpp Wed Dec 30 23:14:20 2009
@@ -90,17 +90,16 @@
ostringstream stream;
- stream << "Begin Class = NetworkBridgeFilter" << std::endl;
- stream << " Value of NetworkBridgeFilter::ID_NETWORKBRIDGEFILTER = 91" << std::endl;
- stream << " Value of NetworkTTL = " << this->getNetworkTTL() << std::endl;
- stream << " Value of NetworkBrokerId is Below:" << std::endl;
+ stream << "NetworkBridgeFilter { ";
+ stream << "NetworkTTL = " << this->getNetworkTTL();
+ stream << ", ";
+ stream << "NetworkBrokerId = ";
if( this->getNetworkBrokerId() != NULL ) {
- stream << this->getNetworkBrokerId()->toString() << std::endl;
+ stream << this->getNetworkBrokerId()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << BaseDataStructure::toString();
- stream << "End Class = NetworkBridgeFilter" << std::endl;
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/PartialCommand.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/PartialCommand.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/PartialCommand.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/PartialCommand.cpp Wed Dec 30 23:14:20 2009
@@ -90,14 +90,20 @@
ostringstream stream;
- stream << "Begin Class = PartialCommand" << std::endl;
- stream << " Value of PartialCommand::ID_PARTIALCOMMAND = 60" << std::endl;
- stream << " Value of CommandId = " << this->getCommandId() << std::endl;
- for( size_t idata = 0; idata < this->getData().size(); ++idata ) {
- stream << " Value of Data[" << idata << "] = " << this->getData()[idata] << std::endl;
+ stream << "PartialCommand { ";
+ stream << "CommandId = " << this->getCommandId();
+ stream << ", ";
+ stream << "Data = ";
+ if( this->getData().size() > 0 ) {
+ stream << "[";
+ for( size_t idata = 0; idata < this->getData().size(); ++idata ) {
+ stream << this->getData()[idata] << ",";
+ }
+ stream << "]";
+ } else {
+ stream << "NULL";
}
- stream << BaseDataStructure::toString();
- stream << "End Class = PartialCommand" << std::endl;
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerAck.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerAck.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerAck.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerAck.cpp Wed Dec 30 23:14:20 2009
@@ -90,17 +90,19 @@
ostringstream stream;
- stream << "Begin Class = ProducerAck" << std::endl;
- stream << " Value of ProducerAck::ID_PRODUCERACK = 19" << std::endl;
- stream << " Value of ProducerId is Below:" << std::endl;
+ stream << "ProducerAck { "
+ << "commandId = " << this->getCommandId() << ", "
+ << "responseRequired = " << boolalpha << this->isResponseRequired();
+ stream << ", ";
+ stream << "ProducerId = ";
if( this->getProducerId() != NULL ) {
- stream << this->getProducerId()->toString() << std::endl;
+ stream << this->getProducerId()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << " Value of Size = " << this->getSize() << std::endl;
- stream << BaseCommand::toString();
- stream << "End Class = ProducerAck" << std::endl;
+ stream << ", ";
+ stream << "Size = " << this->getSize();
+ stream << " }";
return stream.str();
}
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=894734&r1=894733&r2=894734&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 Wed Dec 30 23:14:20 2009
@@ -19,7 +19,9 @@
#include <activemq/exceptions/ActiveMQException.h>
#include <activemq/state/CommandVisitor.h>
#include <apr_strings.h>
+#include <decaf/lang/Long.h>
#include <decaf/lang/exceptions/NullPointerException.h>
+#include <sstream>
using namespace std;
using namespace activemq;
@@ -52,6 +54,27 @@
}
////////////////////////////////////////////////////////////////////////////////
+ProducerId::ProducerId( const SessionId& sessionId, long long consumerId ) {
+ this->connectionId = sessionId.getConnectionId();
+ this->sessionId = sessionId.getValue();
+ this->value = consumerId;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ProducerId::ProducerId( std::string producerKey ) {
+
+ // Parse off the producerId
+ std::size_t p = producerKey.rfind( ':' );
+
+ if( p != std::string::npos ) {
+ value = Long::parseLong( producerKey.substr( p + 1, std::string::npos ) );
+ producerKey = producerKey.substr( 0, p );
+ }
+
+ setProducerSessionKey( producerKey );
+}
+
+////////////////////////////////////////////////////////////////////////////////
ProducerId::~ProducerId() {
}
@@ -99,13 +122,9 @@
ostringstream stream;
- stream << "Begin Class = ProducerId" << std::endl;
- stream << " Value of ProducerId::ID_PRODUCERID = 123" << std::endl;
- stream << " Value of ConnectionId = " << this->getConnectionId() << std::endl;
- stream << " Value of Value = " << this->getValue() << std::endl;
- stream << " Value of SessionId = " << this->getSessionId() << std::endl;
- stream << BaseDataStructure::toString();
- stream << "End Class = ProducerId" << std::endl;
+ stream << this->connectionId << ":"
+ << this->sessionId << ":"
+ << this->value;
return stream.str();
}
@@ -229,3 +248,17 @@
return this->parentId;
}
+////////////////////////////////////////////////////////////////////////////////
+void ProducerId::setProducerSessionKey( std::string sessionKey ) {
+
+ // Parse off the value
+ std::size_t p = sessionKey.rfind( ':' );
+
+ if( p != std::string::npos ) {
+ this->sessionId = Long::parseLong( sessionKey.substr( p + 1, std::string::npos ) );
+ sessionKey = sessionKey.substr( 0, p );
+ }
+
+ // The rest is the value
+ this->connectionId = sessionKey;
+}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerId.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerId.h?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerId.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerId.h Wed Dec 30 23:14:20 2009
@@ -68,11 +68,9 @@
ProducerId( const ProducerId& other );
- ProducerId( const SessionId& sessionId, long long consumerId ) {
- this->connectionId = sessionId.getConnectionId();
- this->sessionId = sessionId.getValue();
- this->value = consumerId;
- }
+ ProducerId( const SessionId& sessionId, long long consumerId );
+
+ ProducerId( std::string producerId );
virtual ~ProducerId();
@@ -114,6 +112,8 @@
const Pointer<SessionId>& getParentId() const;
+ void setProducerSessionKey( std::string sessionKey );
+
virtual const std::string& getConnectionId() const;
virtual std::string& getConnectionId();
virtual void setConnectionId( const std::string& connectionId );
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerInfo.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ProducerInfo.cpp Wed Dec 30 23:14:20 2009
@@ -94,32 +94,43 @@
ostringstream stream;
- stream << "Begin Class = ProducerInfo" << std::endl;
- stream << " Value of ProducerInfo::ID_PRODUCERINFO = 6" << std::endl;
- stream << " Value of ProducerId is Below:" << std::endl;
+ stream << "ProducerInfo { "
+ << "commandId = " << this->getCommandId() << ", "
+ << "responseRequired = " << boolalpha << this->isResponseRequired();
+ stream << ", ";
+ stream << "ProducerId = ";
if( this->getProducerId() != NULL ) {
- stream << this->getProducerId()->toString() << std::endl;
+ stream << this->getProducerId()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << " Value of Destination is Below:" << std::endl;
+ stream << ", ";
+ stream << "Destination = ";
if( this->getDestination() != NULL ) {
- stream << this->getDestination()->toString() << std::endl;
+ stream << this->getDestination()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- for( size_t ibrokerPath = 0; ibrokerPath < this->getBrokerPath().size(); ++ibrokerPath ) {
- stream << " Value of BrokerPath[" << ibrokerPath << "] is Below:" << std::endl;
- if( this->getBrokerPath()[ibrokerPath] != NULL ) {
- stream << this->getBrokerPath()[ibrokerPath]->toString() << std::endl;
- } else {
- stream << " Object is NULL" << std::endl;
+ stream << ", ";
+ stream << "BrokerPath = ";
+ if( this->getBrokerPath().size() > 0 ) {
+ stream << "[";
+ for( size_t ibrokerPath = 0; ibrokerPath < this->getBrokerPath().size(); ++ibrokerPath ) {
+ if( this->getBrokerPath()[ibrokerPath] != NULL ) {
+ stream << this->getBrokerPath()[ibrokerPath]->toString() << ", ";
+ } else {
+ stream << "NULL" << ", ";
+ }
}
+ stream << "]";
+ } else {
+ stream << "NULL";
}
- stream << " Value of DispatchAsync = " << this->isDispatchAsync() << std::endl;
- stream << " Value of WindowSize = " << this->getWindowSize() << std::endl;
- stream << BaseCommand::toString();
- stream << "End Class = ProducerInfo" << std::endl;
+ stream << ", ";
+ stream << "DispatchAsync = " << this->isDispatchAsync();
+ stream << ", ";
+ stream << "WindowSize = " << this->getWindowSize();
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/RemoveInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/RemoveInfo.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/RemoveInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/RemoveInfo.cpp Wed Dec 30 23:14:20 2009
@@ -90,17 +90,19 @@
ostringstream stream;
- stream << "Begin Class = RemoveInfo" << std::endl;
- stream << " Value of RemoveInfo::ID_REMOVEINFO = 12" << std::endl;
- stream << " Value of ObjectId is Below:" << std::endl;
+ stream << "RemoveInfo { "
+ << "commandId = " << this->getCommandId() << ", "
+ << "responseRequired = " << boolalpha << this->isResponseRequired();
+ stream << ", ";
+ stream << "ObjectId = ";
if( this->getObjectId() != NULL ) {
- stream << this->getObjectId()->toString() << std::endl;
+ stream << this->getObjectId()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << " Value of LastDeliveredSequenceId = " << this->getLastDeliveredSequenceId() << std::endl;
- stream << BaseCommand::toString();
- stream << "End Class = RemoveInfo" << std::endl;
+ stream << ", ";
+ stream << "LastDeliveredSequenceId = " << this->getLastDeliveredSequenceId();
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/RemoveSubscriptionInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/RemoveSubscriptionInfo.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/RemoveSubscriptionInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/RemoveSubscriptionInfo.cpp Wed Dec 30 23:14:20 2009
@@ -92,18 +92,21 @@
ostringstream stream;
- stream << "Begin Class = RemoveSubscriptionInfo" << std::endl;
- stream << " Value of RemoveSubscriptionInfo::ID_REMOVESUBSCRIPTIONINFO = 9" << std::endl;
- stream << " Value of ConnectionId is Below:" << std::endl;
+ stream << "RemoveSubscriptionInfo { "
+ << "commandId = " << this->getCommandId() << ", "
+ << "responseRequired = " << boolalpha << this->isResponseRequired();
+ stream << ", ";
+ stream << "ConnectionId = ";
if( this->getConnectionId() != NULL ) {
- stream << this->getConnectionId()->toString() << std::endl;
+ stream << this->getConnectionId()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << " Value of SubcriptionName = " << this->getSubcriptionName() << std::endl;
- stream << " Value of ClientId = " << this->getClientId() << std::endl;
- stream << BaseCommand::toString();
- stream << "End Class = RemoveSubscriptionInfo" << std::endl;
+ stream << ", ";
+ stream << "SubcriptionName = " << this->getSubcriptionName();
+ stream << ", ";
+ stream << "ClientId = " << this->getClientId();
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ReplayCommand.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ReplayCommand.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ReplayCommand.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ReplayCommand.cpp Wed Dec 30 23:14:20 2009
@@ -91,12 +91,14 @@
ostringstream stream;
- stream << "Begin Class = ReplayCommand" << std::endl;
- stream << " Value of ReplayCommand::ID_REPLAYCOMMAND = 65" << std::endl;
- stream << " Value of FirstNakNumber = " << this->getFirstNakNumber() << std::endl;
- stream << " Value of LastNakNumber = " << this->getLastNakNumber() << std::endl;
- stream << BaseCommand::toString();
- stream << "End Class = ReplayCommand" << std::endl;
+ stream << "ReplayCommand { "
+ << "commandId = " << this->getCommandId() << ", "
+ << "responseRequired = " << boolalpha << this->isResponseRequired();
+ stream << ", ";
+ stream << "FirstNakNumber = " << this->getFirstNakNumber();
+ stream << ", ";
+ stream << "LastNakNumber = " << this->getLastNakNumber();
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Response.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Response.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Response.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/Response.cpp Wed Dec 30 23:14:20 2009
@@ -89,11 +89,12 @@
ostringstream stream;
- stream << "Begin Class = Response" << std::endl;
- stream << " Value of Response::ID_RESPONSE = 30" << std::endl;
- stream << " Value of CorrelationId = " << this->getCorrelationId() << std::endl;
- stream << BaseCommand::toString();
- stream << "End Class = Response" << std::endl;
+ stream << "Response { "
+ << "commandId = " << this->getCommandId() << ", "
+ << "responseRequired = " << boolalpha << this->isResponseRequired();
+ stream << ", ";
+ stream << "CorrelationId = " << this->getCorrelationId();
+ stream << " }";
return stream.str();
}
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=894734&r1=894733&r2=894734&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 Wed Dec 30 23:14:20 2009
@@ -23,6 +23,7 @@
#include <activemq/state/CommandVisitor.h>
#include <apr_strings.h>
#include <decaf/lang/exceptions/NullPointerException.h>
+#include <sstream>
using namespace std;
using namespace activemq;
@@ -118,12 +119,7 @@
ostringstream stream;
- stream << "Begin Class = SessionId" << std::endl;
- stream << " Value of SessionId::ID_SESSIONID = 121" << std::endl;
- stream << " Value of ConnectionId = " << this->getConnectionId() << std::endl;
- stream << " Value of Value = " << this->getValue() << std::endl;
- stream << BaseDataStructure::toString();
- stream << "End Class = SessionId" << std::endl;
+ stream << this->connectionId << ":" << this->value;
return stream.str();
}
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=894734&r1=894733&r2=894734&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 Wed Dec 30 23:14:20 2009
@@ -90,16 +90,17 @@
ostringstream stream;
- stream << "Begin Class = SessionInfo" << std::endl;
- stream << " Value of SessionInfo::ID_SESSIONINFO = 4" << std::endl;
- stream << " Value of SessionId is Below:" << std::endl;
+ stream << "SessionInfo { "
+ << "commandId = " << this->getCommandId() << ", "
+ << "responseRequired = " << boolalpha << this->isResponseRequired();
+ stream << ", ";
+ stream << "SessionId = ";
if( this->getSessionId() != NULL ) {
- stream << this->getSessionId()->toString() << std::endl;
+ stream << this->getSessionId()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << BaseCommand::toString();
- stream << "End Class = SessionInfo" << std::endl;
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ShutdownInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ShutdownInfo.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ShutdownInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ShutdownInfo.cpp Wed Dec 30 23:14:20 2009
@@ -87,10 +87,10 @@
ostringstream stream;
- stream << "Begin Class = ShutdownInfo" << std::endl;
- stream << " Value of ShutdownInfo::ID_SHUTDOWNINFO = 11" << std::endl;
- stream << BaseCommand::toString();
- stream << "End Class = ShutdownInfo" << std::endl;
+ stream << "ShutdownInfo { "
+ << "commandId = " << this->getCommandId() << ", "
+ << "responseRequired = " << boolalpha << this->isResponseRequired();
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SubscriptionInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SubscriptionInfo.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SubscriptionInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/SubscriptionInfo.cpp Wed Dec 30 23:14:20 2009
@@ -95,25 +95,27 @@
ostringstream stream;
- stream << "Begin Class = SubscriptionInfo" << std::endl;
- stream << " Value of SubscriptionInfo::ID_SUBSCRIPTIONINFO = 55" << std::endl;
- stream << " Value of ClientId = " << this->getClientId() << std::endl;
- stream << " Value of Destination is Below:" << std::endl;
+ stream << "SubscriptionInfo { ";
+ stream << "ClientId = " << this->getClientId();
+ stream << ", ";
+ stream << "Destination = ";
if( this->getDestination() != NULL ) {
- stream << this->getDestination()->toString() << std::endl;
+ stream << this->getDestination()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << " Value of Selector = " << this->getSelector() << std::endl;
- stream << " Value of SubcriptionName = " << this->getSubcriptionName() << std::endl;
- stream << " Value of SubscribedDestination is Below:" << std::endl;
+ stream << ", ";
+ stream << "Selector = " << this->getSelector();
+ stream << ", ";
+ stream << "SubcriptionName = " << this->getSubcriptionName();
+ stream << ", ";
+ stream << "SubscribedDestination = ";
if( this->getSubscribedDestination() != NULL ) {
- stream << this->getSubscribedDestination()->toString() << std::endl;
+ stream << this->getSubscribedDestination()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << BaseDataStructure::toString();
- stream << "End Class = SubscriptionInfo" << std::endl;
+ stream << " }";
return stream.str();
}
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=894734&r1=894733&r2=894734&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 Wed Dec 30 23:14:20 2009
@@ -93,10 +93,8 @@
ostringstream stream;
- stream << "Begin Class = TransactionId" << std::endl;
- stream << " Value of TransactionId::ID_TRANSACTIONID = 0" << std::endl;
- stream << BaseDataStructure::toString();
- stream << "End Class = TransactionId" << std::endl;
+ stream << "TransactionId { ";
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/TransactionInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/TransactionInfo.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/TransactionInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/TransactionInfo.cpp Wed Dec 30 23:14:20 2009
@@ -91,23 +91,26 @@
ostringstream stream;
- stream << "Begin Class = TransactionInfo" << std::endl;
- stream << " Value of TransactionInfo::ID_TRANSACTIONINFO = 7" << std::endl;
- stream << " Value of ConnectionId is Below:" << std::endl;
+ stream << "TransactionInfo { "
+ << "commandId = " << this->getCommandId() << ", "
+ << "responseRequired = " << boolalpha << this->isResponseRequired();
+ stream << ", ";
+ stream << "ConnectionId = ";
if( this->getConnectionId() != NULL ) {
- stream << this->getConnectionId()->toString() << std::endl;
+ stream << this->getConnectionId()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << " Value of TransactionId is Below:" << std::endl;
+ stream << ", ";
+ stream << "TransactionId = ";
if( this->getTransactionId() != NULL ) {
- stream << this->getTransactionId()->toString() << std::endl;
+ stream << this->getTransactionId()->toString();
} else {
- stream << " Object is NULL" << std::endl;
+ stream << "NULL";
}
- stream << " Value of Type = " << (int)this->getType() << std::endl;
- stream << BaseCommand::toString();
- stream << "End Class = TransactionInfo" << std::endl;
+ stream << ", ";
+ stream << "Type = " << (int)this->getType();
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/WireFormatInfo.cpp Wed Dec 30 23:14:20 2009
@@ -88,35 +88,35 @@
////////////////////////////////////////////////////////////////////////////////
std::string WireFormatInfo::toString() const {
+
std::ostringstream stream;
- stream << "Begin Class = WireFormatInfo" << std::endl;
+ stream << "WireFormatInfo { "
+ << "commandId = " << this->getCommandId() << ", "
+ << "responseRequired = " << boolalpha << this->isResponseRequired() << ", ";
std::vector<unsigned char> magic;
std::vector<unsigned char> marshalledProperties;
+ stream << "Magic = [ ";
for( size_t imagic = 0; imagic < magic.size(); ++imagic ) {
- stream << " Value of magic[" << imagic << "] = " << magic[imagic] << std::endl;
+ stream << magic[imagic];
+ if( imagic < magic.size() - 1 ) {
+ stream << ", ";
+ }
}
- for( size_t imarshalledProperties = 0; imarshalledProperties < marshalledProperties.size(); ++imarshalledProperties ) {
- stream << " Value of marshalledProperties[" << imarshalledProperties << "] = "
- << marshalledProperties[imarshalledProperties] << std::endl;
- }
-
- stream << " Value of properties = " << properties.toString() << std::endl;
- stream << " Value of version = " << version << std::endl;
- stream << " Value of stackTraceEnabled = " << isStackTraceEnabled() << std::endl;
- stream << " Value of tcpNoDelayEnabled = " << isTcpNoDelayEnabled() << std::endl;
- stream << " Value of cacheEnabled = " << isCacheEnabled() << std::endl;
- stream << " Value of cacheSize = " << getCacheSize() << std::endl;
- stream << " Value of tightEncodingEnabled = " << isTightEncodingEnabled() << std::endl;
- stream << " Value of sizePrefixDisabled = " << isSizePrefixDisabled() << std::endl;
- stream << " Value of maxInactivityDuration = " << getMaxInactivityDuration() << std::endl;
- stream << " Value of maxInactivityDuration = " << getMaxInactivityDurationInitalDelay() << std::endl;
+ stream << "Version = " << version << ", ";
+ stream << "StackTraceEnabled = " << isStackTraceEnabled() << ", ";
+ stream << "TcpNoDelayEnabled = " << isTcpNoDelayEnabled() << ", ";
+ stream << "CacheEnabled = " << isCacheEnabled() << ", ";
+ stream << "CacheSize = " << getCacheSize() << ", ";
+ stream << "TightEncodingEnabled = " << isTightEncodingEnabled() << ", ";
+ stream << "SizePrefixDisabled = " << isSizePrefixDisabled() << ", ";
+ stream << "MaxInactivityDuration = " << getMaxInactivityDuration() << ", ";
+ stream << "MaxInactivityDuration = " << getMaxInactivityDurationInitalDelay();
- stream << BaseCommand::toString();
- stream << "End Class = WireFormatInfo" << std::endl;
+ stream << " }";
return stream.str();
}
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=894734&r1=894733&r2=894734&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 Wed Dec 30 23:14:20 2009
@@ -97,17 +97,31 @@
ostringstream stream;
- stream << "Begin Class = XATransactionId" << std::endl;
- stream << " Value of XATransactionId::ID_XATRANSACTIONID = 112" << std::endl;
- stream << " Value of FormatId = " << this->getFormatId() << std::endl;
- for( size_t iglobalTransactionId = 0; iglobalTransactionId < this->getGlobalTransactionId().size(); ++iglobalTransactionId ) {
- stream << " Value of GlobalTransactionId[" << iglobalTransactionId << "] = " << this->getGlobalTransactionId()[iglobalTransactionId] << std::endl;
- }
- for( size_t ibranchQualifier = 0; ibranchQualifier < this->getBranchQualifier().size(); ++ibranchQualifier ) {
- stream << " Value of BranchQualifier[" << ibranchQualifier << "] = " << this->getBranchQualifier()[ibranchQualifier] << std::endl;
+ stream << "XATransactionId { ";
+ stream << "FormatId = " << this->getFormatId();
+ stream << ", ";
+ stream << "GlobalTransactionId = ";
+ if( this->getGlobalTransactionId().size() > 0 ) {
+ stream << "[";
+ for( size_t iglobalTransactionId = 0; iglobalTransactionId < this->getGlobalTransactionId().size(); ++iglobalTransactionId ) {
+ stream << this->getGlobalTransactionId()[iglobalTransactionId] << ",";
+ }
+ stream << "]";
+ } else {
+ stream << "NULL";
+ }
+ stream << ", ";
+ stream << "BranchQualifier = ";
+ if( this->getBranchQualifier().size() > 0 ) {
+ stream << "[";
+ for( size_t ibranchQualifier = 0; ibranchQualifier < this->getBranchQualifier().size(); ++ibranchQualifier ) {
+ stream << this->getBranchQualifier()[ibranchQualifier] << ",";
+ }
+ stream << "]";
+ } else {
+ stream << "NULL";
}
- stream << TransactionId::toString();
- stream << "End Class = XATransactionId" << std::endl;
+ stream << " }";
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/logging/LoggingTransport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/logging/LoggingTransport.cpp?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/logging/LoggingTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/logging/LoggingTransport.cpp Wed Dec 30 23:14:20 2009
@@ -27,9 +27,6 @@
using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
-LOGDECAF_INITIALIZE( logger, LoggingTransport, "activemq.transport.logging.LoggingTransport")
-
-////////////////////////////////////////////////////////////////////////////////
LoggingTransport::LoggingTransport( const Pointer<Transport>& next )
: TransportFilter( next )
{}
@@ -37,12 +34,7 @@
////////////////////////////////////////////////////////////////////////////////
void LoggingTransport::onCommand( const Pointer<Command>& command ) {
- ostringstream ostream;
- ostream << "*** BEGIN RECEIVED ASYNCHRONOUS COMMAND ***" << endl;
- ostream << command->toString() << endl;
- ostream << "*** END RECEIVED ASYNCHRONOUS COMMAND ***";
-
- LOGDECAF_INFO( logger, ostream.str() );
+ std::cout << "RECV: " << command->toString() << std::endl;
// Delegate to the base class.
TransportFilter::onCommand( command );
@@ -54,12 +46,7 @@
try {
- ostringstream ostream;
- ostream << "*** BEGIN SENDING ONEWAY COMMAND ***" << endl;
- ostream << command->toString() << endl;
- ostream << "*** END SENDING ONEWAY COMMAND ***";
-
- LOGDECAF_INFO( logger, ostream.str() );
+ std::cout << "SEND: " << command->toString() << std::endl;
// Delegate to the base class.
TransportFilter::oneway( command );
@@ -76,17 +63,11 @@
try {
+ std::cout << "SEND: " << command->toString() << std::endl;
+
// Delegate to the base class.
Pointer<Response> response = TransportFilter::request( command );
- ostringstream ostream;
- ostream << "*** SENDING REQUEST COMMAND ***" << endl;
- ostream << command->toString() << endl;
- ostream << "*** RECEIVED RESPONSE COMMAND ***" << endl;
- ostream << ( response == NULL? "NULL" : response->toString() );
-
- LOGDECAF_INFO( logger, ostream.str() );
-
return response;
}
AMQ_CATCH_RETHROW( IOException )
@@ -101,17 +82,11 @@
try {
+ std::cout << "SEND: " << command->toString() << std::endl;
+
// Delegate to the base class.
Pointer<Response> response = TransportFilter::request( command, timeout );
- ostringstream ostream;
- ostream << "*** SENDING REQUEST COMMAND: Timeout = " << timeout << " ***" << endl;
- ostream << command->toString() << endl;
- ostream << "*** RECEIVED RESPONSE COMMAND ***" << endl;
- ostream << ( response == NULL? "NULL" : response->toString() );
-
- LOGDECAF_INFO( logger, ostream.str() );
-
return response;
}
AMQ_CATCH_RETHROW( IOException )
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/logging/LoggingTransport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/logging/LoggingTransport.h?rev=894734&r1=894733&r2=894734&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/logging/LoggingTransport.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/logging/LoggingTransport.h Wed Dec 30 23:14:20 2009
@@ -20,7 +20,6 @@
#include <activemq/util/Config.h>
#include <activemq/transport/TransportFilter.h>
-#include <decaf/util/logging/LoggerDefines.h>
#include <decaf/lang/Pointer.h>
namespace activemq{
@@ -33,10 +32,6 @@
* A transport filter that logs commands as they are sent/received.
*/
class AMQCPP_API LoggingTransport : public TransportFilter {
- private:
-
- LOGDECAF_DECLARE( logger )
-
public:
/**