activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r508940 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands: ActiveMQDestination.cpp ActiveMQDestination.h
Date Sun, 18 Feb 2007 18:43:00 GMT
Author: tabish
Date: Sun Feb 18 10:42:59 2007
New Revision: 508940

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

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.cpp?view=diff&rev=508940&r1=508939&r2=508940
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.cpp
Sun Feb 18 10:42:59 2007
@@ -28,11 +28,11 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 const std::string ActiveMQDestination::ADVISORY_PREFIX = "ActiveMQ.Advisory.";
-const std::string ActiveMQDestination::CONSUMER_ADVISORY_PREFIX = 
+const std::string ActiveMQDestination::CONSUMER_ADVISORY_PREFIX =
     ActiveMQDestination::ADVISORY_PREFIX + "Consumers.";
-const std::string ActiveMQDestination::PRODUCER_ADVISORY_PREFIX = 
+const std::string ActiveMQDestination::PRODUCER_ADVISORY_PREFIX =
     ActiveMQDestination::ADVISORY_PREFIX + "Producers.";
-const std::string ActiveMQDestination::CONNECTION_ADVISORY_PREFIX = 
+const std::string ActiveMQDestination::CONNECTION_ADVISORY_PREFIX =
     ActiveMQDestination::ADVISORY_PREFIX + "Connections.";
 const std::string ActiveMQDestination::DEFAULT_ORDERED_TARGET = "coordinator";
 const std::string ActiveMQDestination::TEMP_PREFIX = "{TD{";
@@ -43,7 +43,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination::ActiveMQDestination() {
-    
+
     this->physicalName = "";
     this->orderedTarget = DEFAULT_ORDERED_TARGET;
     this->exclusive = false;
@@ -63,7 +63,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQDestination::setPhysicalName( const std::string& physicalName ) {
-    
+
     this->physicalName = physicalName;
 
     size_t pos = physicalName.find_first_of('?');
@@ -83,16 +83,16 @@
     // Copy the data of the base class or classes
     BaseDataStructure::copyDataStructure( src );
 
-    const ActiveMQDestination* srcPtr = 
+    const ActiveMQDestination* srcPtr =
         dynamic_cast<const ActiveMQDestination*>( src );
 
     if( srcPtr == NULL || src == NULL ) {
-    
+
         throw exceptions::NullPointerException(
             __FILE__, __LINE__,
             "BrokerId::copyDataStructure - src is NULL or invalid" );
     }
-    
+
     this->setPhysicalName( srcPtr->getPhysicalName() );
     this->setAdvisory( srcPtr->isAdvisory() );
     this->setOrdered( srcPtr->isOrdered() );
@@ -101,13 +101,34 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQDestination::toString() const {
+    std::ostringstream stream;
+
+    stream << "Begin Class = ActiveMQDestination" << std::endl;
+
+    stream << " Value of exclusive = "
+           << std::boolalpha << exclusive << std::endl;
+    stream << " Value of ordered = "
+           << std::boolalpha << ordered << std::endl;
+    stream << " Value of advisory = "
+           << std::boolalpha << advisory << std::endl;
+    stream << " Value of orderedTarget = " << orderedTarget << std::endl;
+    stream << " Value of physicalName = " << physicalName << std::endl;
+    stream << " Value of options = " << this->options.toString() <<
std::endl;
+    stream << BaseDataStructure::toString();
+    stream << "Begin Class = ActiveMQDestination" << std::endl;
+
+    return stream.str();
+}
+
+////////////////////////////////////////////////////////////////////////////////
 unsigned char ActiveMQDestination::getDataStructureType() const
 {
-    return ActiveMQDestination::ID_ACTIVEMQDESTINATION; 
+    return ActiveMQDestination::ID_ACTIVEMQDESTINATION;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::string ActiveMQDestination::getClientId( 
+std::string ActiveMQDestination::getClientId(
     const ActiveMQDestination* destination )
 {
     std::string answer = "";

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.h?view=diff&rev=508940&r1=508939&r2=508940
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQDestination.h
Sun Feb 18 10:42:59 2007
@@ -110,6 +110,13 @@
         virtual unsigned char getDataStructureType() const;
 
         /**
+         * Returns a string containing the information for this DataStructure
+         * such as its type and value of its elements.
+         * @return formatted string useful for debugging.
+         */
+        virtual std::string toString() const;
+
+        /**
          * Fetch this destination's physical name
          * @returns const string containing the name
          */



Mime
View raw message