activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r738619 [1/3] - in /activemq/activemq-cpp/trunk/src: main/ main/activemq/commands/ main/activemq/core/ main/activemq/state/ main/activemq/transport/ main/activemq/transport/correlator/ main/activemq/transport/failover/ main/activemq/transpo...
Date Wed, 28 Jan 2009 20:59:10 GMT
Author: tabish
Date: Wed Jan 28 20:59:07 2009
New Revision: 738619

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

Further refactoring of the commands and transport packages to make the heirarchy simpler.  The transport's Command and Response are gone, the Openwire generator code has been updated to wire in the CommandVisitor calls in the new visit methods of all the Commands.  

Added:
    activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerError.cpp   (with props)
    activemq/activemq-cpp/trunk/src/main/activemq/commands/Command.h   (with props)
Removed:
    activemq/activemq-cpp/trunk/src/main/activemq/transport/Command.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/Response.h
Modified:
    activemq/activemq-cpp/trunk/src/main/Makefile.am
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/BaseCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/BaseDataStructure.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerError.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerId.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionId.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerId.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ReplayCommand.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ReplayCommand.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/Response.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/Response.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/SessionId.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/SessionInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/SessionInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ShutdownInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/ShutdownInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/SubscriptionInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionId.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/WireFormatInfo.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/WireFormatInfo.h
    activemq/activemq-cpp/trunk/src/main/activemq/commands/XATransactionId.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/commands/srcmakefile.mk
    activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.h
    activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQSession.h
    activemq/activemq-cpp/trunk/src/main/activemq/state/CommandVisitor.h
    activemq/activemq-cpp/trunk/src/main/activemq/state/CommandVisitorAdapter.h
    activemq/activemq-cpp/trunk/src/main/activemq/state/Tracked.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/state/Tracked.h
    activemq/activemq-cpp/trunk/src/main/activemq/state/TransactionState.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/state/TransactionState.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/DefaultTransportListener.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/IOTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/Transport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportFilter.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/TransportListener.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/FutureResponse.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/correlator/ResponseCorrelator.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/failover/FailoverTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/logging/LoggingTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransport.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/transport/mock/MockTransport.h
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/WireFormat.h
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormat.h
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormatNegotiator.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireFormatNegotiator.h
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireResponseBuilder.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/OpenWireResponseBuilder.h
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v1/BaseCommandMarshaller.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v2/BaseCommandMarshaller.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/openwire/marshal/v3/BaseCommandMarshaller.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompResponseBuilder.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompResponseBuilder.h
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/StompWireFormat.h
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/wireformat/stomp/marshal/Marshaler.h
    activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java
    activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java
    activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppMarshallingClassesGenerator.java
    activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h
    activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/transport/correlator/ResponseCorrelatorTest.h

Modified: activemq/activemq-cpp/trunk/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/Makefile.am?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/src/main/Makefile.am Wed Jan 28 20:59:07 2009
@@ -198,11 +198,9 @@
     activemq/state/TransactionState.h \
     activemq/state/Tracked.h \
     activemq/transport/AbstractTransportFactory.h \
-    activemq/transport/Command.h \
     activemq/transport/CommandIOException.h \
     activemq/transport/DefaultTransportListener.h \
     activemq/transport/IOTransport.h \
-    activemq/transport/Response.h \
     activemq/transport/Transport.h \
     activemq/transport/TransportListener.h \
     activemq/transport/TransportFilter.h \

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempDestination.h Wed Jan 28 20:59:07 2009
@@ -25,6 +25,7 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/ActiveMQDestination.h>
+#include <activemq/exceptions/ActiveMQException.h>
 #include <cms/Closeable.h>
 #include <vector>
 #include <string>

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQTempQueue.cpp Wed Jan 28 20:59:07 2009
@@ -16,6 +16,8 @@
  */
 #include <activemq/commands/ActiveMQTempQueue.h>
 
+#include <activemq/exceptions/ActiveMQException.h>
+
 using namespace std;
 using namespace activemq;
 using namespace activemq::commands;

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/BaseCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/BaseCommand.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/BaseCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/BaseCommand.h Wed Jan 28 20:59:07 2009
@@ -19,16 +19,17 @@
 #define _ACTIVEMQ_COMMANDS_BASECOMMAND_H_
 
 #include <activemq/util/Config.h>
-#include <activemq/transport/Command.h>
-#include <activemq/transport/Response.h>
-#include <activemq/commands/BaseDataStructure.h>
+#include <activemq/commands/Command.h>
 
 namespace activemq{
 namespace commands{
 
-    template< typename T >
-    class AMQCPP_API BaseCommand : public T,
-                                   public BaseDataStructure {
+    class AMQCPP_API BaseCommand : public Command {
+    private:
+
+        bool responseRequired;
+        int commandId;
+
     public:
 
         BaseCommand() {
@@ -71,23 +72,14 @@
         }
 
         /**
-         * Returns a Cloned copy of this command, the caller is responsible
-         * for deallocating the returned object.
-         * @returns new copy of this command.
-         */
-        virtual transport::Command* cloneCommand() const {
-            return dynamic_cast<transport::Command*>( this->cloneDataStructure() );
-        }
-
-        /**
          * Copy the contents of the passed object into this objects
          * members, overwriting any existing data.
          * @return src - Source Object
          */
         virtual void copyDataStructure( const DataStructure* src ) {
 
-            const BaseCommand<T>* command =
-                dynamic_cast< const BaseCommand<T>* >( src );
+            const BaseCommand* command =
+                dynamic_cast< const BaseCommand* >( src );
 
             this->setResponseRequired( command->isResponseRequired() );
             this->setCommandId( command->getCommandId() );
@@ -120,11 +112,6 @@
             return BaseDataStructure::equals( value );
         }
 
-    private:
-
-        bool responseRequired;
-        int commandId;
-
     };
 
 }}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/BaseDataStructure.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/BaseDataStructure.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/BaseDataStructure.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/BaseDataStructure.h Wed Jan 28 20:59:07 2009
@@ -20,12 +20,14 @@
 
 #include <activemq/util/Config.h>
 #include <activemq/commands/DataStructure.h>
-#include <activemq/wireformat/WireFormat.h>
 
 #include <string>
 #include <sstream>
 
 namespace activemq{
+namespace wireformat{
+    class WireFormat;
+}
 namespace commands{
 
     class AMQCPP_API BaseDataStructure : public DataStructure {

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerError.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerError.cpp?rev=738619&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerError.cpp (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerError.cpp Wed Jan 28 20:59:07 2009
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <activemq/commands/BrokerError.h>
+#include <activemq/state/CommandVisitor.h>
+#include <activemq/exceptions/ActiveMQException.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::exceptions;
+using namespace activemq::commands;
+using namespace decaf::lang::exceptions;
+
+////////////////////////////////////////////////////////////////////////////////
+BrokerError::~BrokerError() {
+    for( unsigned int i = 0; i < stackTraceElements.size(); ++i ) {
+        delete stackTraceElements[i];
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void BrokerError::copyDataStructure( const DataStructure* src ) {
+
+    const BrokerError* srcErr = dynamic_cast<const BrokerError*>( src );
+
+    if( srcErr == NULL || src == NULL ) {
+        throw decaf::lang::exceptions::NullPointerException(
+            __FILE__, __LINE__,
+            "BrokerError::copyCommand - src is NULL or invalid" );
+    }
+
+    this->setMessage( srcErr->getMessage() );
+    this->setExceptionClass( srcErr->getExceptionClass() );
+
+    for( unsigned int i = 0; i < srcErr->getStackTraceElements().size(); ++i ) {
+        if( srcErr->getStackTraceElements()[i] != NULL ) {
+            StackTraceElement* element = new StackTraceElement;
+            *element = *( srcErr->getStackTraceElements()[i] );
+
+            // store the copy
+            this->stackTraceElements.push_back( element );
+        }
+    }
+
+    if( srcErr->getCause() ) {
+        this->cause = dynamic_cast<BrokerError*>(
+            srcErr->getCause()->cloneDataStructure() );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+commands::Command* BrokerError::visit( activemq::state::CommandVisitor* visitor )
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processBrokerError( this );
+}

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerError.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerError.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerError.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerError.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerError.h Wed Jan 28 20:59:07 2009
@@ -32,7 +32,7 @@
      * This class represents an Exception sent from the Broker.  The Broker
      * sends java Throwables, so we must mimic its structure here.
      */
-    class AMQCPP_API BrokerError : public BaseCommand<transport::Command> {
+    class AMQCPP_API BrokerError : public BaseCommand {
     public:
 
         struct StackTraceElement
@@ -46,11 +46,7 @@
     public:
 
         BrokerError() {}
-        virtual ~BrokerError() {
-            for( unsigned int i = 0; i < stackTraceElements.size(); ++i ) {
-                delete stackTraceElements[i];
-            }
-        }
+        virtual ~BrokerError();
 
         /**
          * Get the DataStructure Type as defined in CommandTypes.h
@@ -77,34 +73,17 @@
          * members, overwriting any existing data.
          * @return src - Source Object
          */
-        virtual void copyDataStructure( const DataStructure* src ) {
-
-            const BrokerError* srcErr = dynamic_cast<const BrokerError*>( src );
+        virtual void copyDataStructure( const DataStructure* src );
 
-            if( srcErr == NULL || src == NULL ) {
-                throw decaf::lang::exceptions::NullPointerException(
-                    __FILE__, __LINE__,
-                    "BrokerError::copyCommand - src is NULL or invalid" );
-            }
-
-            this->setMessage( srcErr->getMessage() );
-            this->setExceptionClass( srcErr->getExceptionClass() );
-
-            for( unsigned int i = 0; i < srcErr->getStackTraceElements().size(); ++i ) {
-                if( srcErr->getStackTraceElements()[i] != NULL ) {
-                    StackTraceElement* element = new StackTraceElement;
-                    *element = *( srcErr->getStackTraceElements()[i] );
-
-                    // store the copy
-                    this->stackTraceElements.push_back( element );
-                }
-            }
-
-            if( srcErr->getCause() ) {
-                this->cause = dynamic_cast<BrokerError*>(
-                    srcErr->getCause()->cloneDataStructure() );
-            }
-        }
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         *
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
 
         /**
          * Gets the string holding the error message

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerId.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerId.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerId.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/BrokerId.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/BrokerInfo.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -73,7 +74,7 @@
 void BrokerInfo::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const BrokerInfo* srcPtr = dynamic_cast<const BrokerInfo*>( src );
 
@@ -145,7 +146,7 @@
     stream << " Value of ConnectionId = " << this->getConnectionId() << std::endl;
     stream << " Value of BrokerUploadUrl = " << this->getBrokerUploadUrl() << std::endl;
     stream << " Value of NetworkProperties = " << this->getNetworkProperties() << std::endl;
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = BrokerInfo" << std::endl;
 
     return stream.str();
@@ -204,13 +205,20 @@
     if( this->getNetworkProperties() != valuePtr->getNetworkProperties() ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* BrokerInfo::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processBrokerInfo( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 const BrokerId* BrokerInfo::getBrokerId() const {
     return brokerId;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.h Wed Jan 28 20:59:07 2009
@@ -43,7 +43,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API BrokerInfo : public BaseCommand<transport::Command> {
+    class AMQCPP_API BrokerInfo : public BaseCommand {
     protected:
 
         BrokerId* brokerId;
@@ -104,6 +104,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual const BrokerId* getBrokerId() const;
         virtual BrokerId* getBrokerId();
         virtual void setBrokerId( BrokerId* brokerId );

Added: activemq/activemq-cpp/trunk/src/main/activemq/commands/Command.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/Command.h?rev=738619&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/Command.h (added)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/Command.h Wed Jan 28 20:59:07 2009
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACTIVEMQ_COMMANDS_COMMAND_H_
+#define _ACTIVEMQ_COMMANDS_COMMAND_H_
+
+#include <string>
+#include <activemq/util/Config.h>
+#include <activemq/commands/BaseDataStructure.h>
+#include <activemq/exceptions/ActiveMQException.h>
+
+namespace activemq{
+namespace state{
+    class CommandVisitor;
+}
+namespace commands{
+
+    class AMQCPP_API Command : public BaseDataStructure {
+    public:
+
+        virtual ~Command() {}
+
+        /**
+         * Sets the Command Id of this Message
+         * @param id Command Id
+         */
+        virtual void setCommandId( int id ) = 0;
+
+        /**
+         * Gets the Command Id of this Message
+         * @return Command Id
+         */
+        virtual int getCommandId() const = 0;
+
+        /**
+         * Set if this Message requires a Response
+         * @param required true if response is required
+         */
+        virtual void setResponseRequired( const bool required ) = 0;
+
+        /**
+         * Is a Response required for this Command
+         * @return true if a response is required.
+         */
+        virtual bool isResponseRequired() const = 0;
+
+        /**
+         * Returns a provider-specific string that provides information
+         * about the contents of the command.
+         */
+        virtual std::string toString() const = 0;
+
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         *
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException ) = 0;
+
+    };
+
+}}
+
+#endif /*_ACTIVEMQ_COMMANDS_COMMAND_H_*/

Propchange: activemq/activemq-cpp/trunk/src/main/activemq/commands/Command.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/ConnectionControl.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -63,7 +64,7 @@
 void ConnectionControl::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const ConnectionControl* srcPtr = dynamic_cast<const ConnectionControl*>( src );
 
@@ -97,7 +98,7 @@
     stream << " Value of FaultTolerant = " << this->isFaultTolerant() << std::endl;
     stream << " Value of Resume = " << this->isResume() << std::endl;
     stream << " Value of Suspend = " << this->isSuspend() << std::endl;
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = ConnectionControl" << std::endl;
 
     return stream.str();
@@ -125,13 +126,20 @@
     if( this->isSuspend() != valuePtr->isSuspend() ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* ConnectionControl::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processConnectionControl( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 bool ConnectionControl::isClose() const {
     return close;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.h Wed Jan 28 20:59:07 2009
@@ -41,7 +41,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API ConnectionControl : public BaseCommand<transport::Command> {
+    class AMQCPP_API ConnectionControl : public BaseCommand {
     protected:
 
         bool close;
@@ -95,6 +95,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual bool isClose() const;
         virtual void setClose( bool close );
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/ConnectionError.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -62,7 +63,7 @@
 void ConnectionError::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const ConnectionError* srcPtr = dynamic_cast<const ConnectionError*>( src );
 
@@ -108,7 +109,7 @@
     } else {
         stream << "   Object is NULL" << std::endl;
     }
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = ConnectionError" << std::endl;
 
     return stream.str();
@@ -135,13 +136,20 @@
     } else if( valuePtr->getConnectionId() != NULL ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* ConnectionError::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processConnectionError( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 const BrokerError* ConnectionError::getException() const {
     return exception;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.h Wed Jan 28 20:59:07 2009
@@ -43,7 +43,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API ConnectionError : public BaseCommand<transport::Command> {
+    class AMQCPP_API ConnectionError : public BaseCommand {
     protected:
 
         BrokerError* exception;
@@ -94,6 +94,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual const BrokerError* getException() const;
         virtual BrokerError* getException();
         virtual void setException( BrokerError* exception );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionId.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionId.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionId.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/ConnectionId.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/ConnectionInfo.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -69,7 +70,7 @@
 void ConnectionInfo::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const ConnectionInfo* srcPtr = dynamic_cast<const ConnectionInfo*>( src );
 
@@ -133,7 +134,7 @@
     stream << " Value of BrokerMasterConnector = " << this->isBrokerMasterConnector() << std::endl;
     stream << " Value of Manageable = " << this->isManageable() << std::endl;
     stream << " Value of ClientMaster = " << this->isClientMaster() << std::endl;
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = ConnectionInfo" << std::endl;
 
     return stream.str();
@@ -180,13 +181,20 @@
     if( this->isClientMaster() != valuePtr->isClientMaster() ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* ConnectionInfo::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processConnectionInfo( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 const ConnectionId* ConnectionInfo::getConnectionId() const {
     return connectionId;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.h Wed Jan 28 20:59:07 2009
@@ -43,7 +43,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API ConnectionInfo : public BaseCommand<transport::Command> {
+    class AMQCPP_API ConnectionInfo : public BaseCommand {
     protected:
 
         ConnectionId* connectionId;
@@ -100,6 +100,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual const ConnectionId* getConnectionId() const;
         virtual ConnectionId* getConnectionId();
         virtual void setConnectionId( ConnectionId* connectionId );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/ConsumerControl.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -65,7 +66,7 @@
 void ConsumerControl::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const ConsumerControl* srcPtr = dynamic_cast<const ConsumerControl*>( src );
 
@@ -110,7 +111,7 @@
     stream << " Value of Flush = " << this->isFlush() << std::endl;
     stream << " Value of Start = " << this->isStart() << std::endl;
     stream << " Value of Stop = " << this->isStop() << std::endl;
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = ConsumerControl" << std::endl;
 
     return stream.str();
@@ -145,13 +146,20 @@
     if( this->isStop() != valuePtr->isStop() ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* ConsumerControl::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processConsumerControl( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 bool ConsumerControl::isClose() const {
     return close;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.h Wed Jan 28 20:59:07 2009
@@ -42,7 +42,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API ConsumerControl : public BaseCommand<transport::Command> {
+    class AMQCPP_API ConsumerControl : public BaseCommand {
     protected:
 
         bool close;
@@ -97,6 +97,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual bool isClose() const;
         virtual void setClose( bool close );
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerId.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerId.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerId.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/ConsumerId.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/ConsumerInfo.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -80,7 +81,7 @@
 void ConsumerInfo::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const ConsumerInfo* srcPtr = dynamic_cast<const ConsumerInfo*>( src );
 
@@ -180,7 +181,7 @@
     stream << " Value of NetworkSubscription = " << this->isNetworkSubscription() << std::endl;
     stream << " Value of OptimizedAcknowledge = " << this->isOptimizedAcknowledge() << std::endl;
     stream << " Value of NoRangeAcks = " << this->isNoRangeAcks() << std::endl;
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = ConsumerInfo" << std::endl;
 
     return stream.str();
@@ -262,13 +263,20 @@
     if( this->isNoRangeAcks() != valuePtr->isNoRangeAcks() ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* ConsumerInfo::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processConsumerInfo( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 const ConsumerId* ConsumerInfo::getConsumerId() const {
     return consumerId;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.h Wed Jan 28 20:59:07 2009
@@ -45,7 +45,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API ConsumerInfo : public BaseCommand<transport::Command> {
+    class AMQCPP_API ConsumerInfo : public BaseCommand {
     protected:
 
         ConsumerId* consumerId;
@@ -111,6 +111,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual const ConsumerId* getConsumerId() const;
         virtual ConsumerId* getConsumerId();
         virtual void setConsumerId( ConsumerId* consumerId );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/ControlCommand.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -59,7 +60,7 @@
 void ControlCommand::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const ControlCommand* srcPtr = dynamic_cast<const ControlCommand*>( src );
 
@@ -85,7 +86,7 @@
     stream << "Begin Class = ControlCommand" << std::endl;
     stream << " Value of ControlCommand::ID_CONTROLCOMMAND = 14" << std::endl;
     stream << " Value of Command = " << this->getCommand() << std::endl;
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = ControlCommand" << std::endl;
 
     return stream.str();
@@ -101,13 +102,20 @@
     if( this->getCommand() != valuePtr->getCommand() ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* ControlCommand::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processControlCommand( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 const std::string& ControlCommand::getCommand() const {
     return command;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.h Wed Jan 28 20:59:07 2009
@@ -41,7 +41,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API ControlCommand : public BaseCommand<transport::Command> {
+    class AMQCPP_API ControlCommand : public BaseCommand {
     protected:
 
         std::string command;
@@ -91,6 +91,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual const std::string& getCommand() const;
         virtual std::string& getCommand();
         virtual void setCommand( const std::string& command );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/DataArrayResponse.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/DataResponse.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/DestinationInfo.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -67,7 +68,7 @@
 void DestinationInfo::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const DestinationInfo* srcPtr = dynamic_cast<const DestinationInfo*>( src );
 
@@ -134,7 +135,7 @@
             stream << "   Object is NULL" << std::endl;
         }
     }
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = DestinationInfo" << std::endl;
 
     return stream.str();
@@ -176,13 +177,20 @@
             return false;
         }
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* DestinationInfo::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processDestinationInfo( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 const ConnectionId* DestinationInfo::getConnectionId() const {
     return connectionId;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.h Wed Jan 28 20:59:07 2009
@@ -44,7 +44,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API DestinationInfo : public BaseCommand<transport::Command> {
+    class AMQCPP_API DestinationInfo : public BaseCommand {
     protected:
 
         ConnectionId* connectionId;
@@ -98,6 +98,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual const ConnectionId* getConnectionId() const;
         virtual ConnectionId* getConnectionId();
         virtual void setConnectionId( ConnectionId* connectionId );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/DiscoveryEvent.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/ExceptionResponse.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/FlushCommand.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -58,7 +59,7 @@
 void FlushCommand::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const FlushCommand* srcPtr = dynamic_cast<const FlushCommand*>( src );
 
@@ -82,7 +83,7 @@
 
     stream << "Begin Class = FlushCommand" << std::endl;
     stream << " Value of FlushCommand::ID_FLUSHCOMMAND = 15" << std::endl;
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = FlushCommand" << std::endl;
 
     return stream.str();
@@ -95,9 +96,16 @@
     if( valuePtr == NULL || value == NULL ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
+////////////////////////////////////////////////////////////////////////////////
+commands::Command* FlushCommand::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processFlushCommand( this );
+}
+

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.h Wed Jan 28 20:59:07 2009
@@ -41,7 +41,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API FlushCommand : public BaseCommand<transport::Command> {
+    class AMQCPP_API FlushCommand : public BaseCommand {
     protected:
 
 
@@ -90,6 +90,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
     };
 
 }}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/IntegerResponse.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/JournalQueueAck.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/JournalTopicAck.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/JournalTrace.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/JournalTransaction.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/KeepAliveInfo.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -58,7 +59,7 @@
 void KeepAliveInfo::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const KeepAliveInfo* srcPtr = dynamic_cast<const KeepAliveInfo*>( src );
 
@@ -82,7 +83,7 @@
 
     stream << "Begin Class = KeepAliveInfo" << std::endl;
     stream << " Value of KeepAliveInfo::ID_KEEPALIVEINFO = 10" << std::endl;
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = KeepAliveInfo" << std::endl;
 
     return stream.str();
@@ -95,9 +96,16 @@
     if( valuePtr == NULL || value == NULL ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
+////////////////////////////////////////////////////////////////////////////////
+commands::Command* KeepAliveInfo::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processKeepAliveInfo( this );
+}
+

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.h Wed Jan 28 20:59:07 2009
@@ -41,7 +41,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API KeepAliveInfo : public BaseCommand<transport::Command> {
+    class AMQCPP_API KeepAliveInfo : public BaseCommand {
     protected:
 
 
@@ -90,6 +90,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
     };
 
 }}

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/LastPartialCommand.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/LocalTransactionId.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/Message.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -98,7 +99,7 @@
 void Message::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const Message* srcPtr = dynamic_cast<const Message*>( src );
 
@@ -295,7 +296,7 @@
     }
     stream << " Value of BrokerInTime = " << this->getBrokerInTime() << std::endl;
     stream << " Value of BrokerOutTime = " << this->getBrokerOutTime() << std::endl;
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = Message" << std::endl;
 
     return stream.str();
@@ -447,7 +448,7 @@
     if( this->getBrokerOutTime() != valuePtr->getBrokerOutTime() ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
@@ -465,6 +466,13 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* Message::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processMessage( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 const ProducerId* Message::getProducerId() const {
     return producerId;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.h Wed Jan 28 20:59:07 2009
@@ -52,7 +52,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API Message : public BaseCommand<transport::Command> {
+    class AMQCPP_API Message : public BaseCommand {
     protected:
 
         static const unsigned int DEFAULT_MESSAGE_SIZE = 1024;
@@ -138,6 +138,16 @@
          */
         virtual unsigned int getSize() const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual const ProducerId* getProducerId() const;
         virtual ProducerId* getProducerId();
         virtual void setProducerId( ProducerId* producerId );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/MessageAck.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -70,7 +71,7 @@
 void MessageAck::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const MessageAck* srcPtr = dynamic_cast<const MessageAck*>( src );
 
@@ -153,7 +154,7 @@
         stream << "   Object is NULL" << std::endl;
     }
     stream << " Value of MessageCount = " << this->getMessageCount() << std::endl;
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = MessageAck" << std::endl;
 
     return stream.str();
@@ -207,13 +208,20 @@
     if( this->getMessageCount() != valuePtr->getMessageCount() ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* MessageAck::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processMessageAck( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 const ActiveMQDestination* MessageAck::getDestination() const {
     return destination;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.h Wed Jan 28 20:59:07 2009
@@ -46,7 +46,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API MessageAck : public BaseCommand<transport::Command> {
+    class AMQCPP_API MessageAck : public BaseCommand {
     protected:
 
         ActiveMQDestination* destination;
@@ -102,6 +102,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual const ActiveMQDestination* getDestination() const;
         virtual ActiveMQDestination* getDestination();
         virtual void setDestination( ActiveMQDestination* destination );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/MessageDispatch.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -65,7 +66,7 @@
 void MessageDispatch::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const MessageDispatch* srcPtr = dynamic_cast<const MessageDispatch*>( src );
 
@@ -124,7 +125,7 @@
         stream << "   Object is NULL" << std::endl;
     }
     stream << " Value of RedeliveryCounter = " << this->getRedeliveryCounter() << std::endl;
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = MessageDispatch" << std::endl;
 
     return stream.str();
@@ -161,13 +162,20 @@
     if( this->getRedeliveryCounter() != valuePtr->getRedeliveryCounter() ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* MessageDispatch::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processMessageDispatch( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 const ConsumerId* MessageDispatch::getConsumerId() const {
     return consumerId;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.h Wed Jan 28 20:59:07 2009
@@ -44,7 +44,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API MessageDispatch : public BaseCommand<transport::Command> {
+    class AMQCPP_API MessageDispatch : public BaseCommand {
     protected:
 
         ConsumerId* consumerId;
@@ -97,6 +97,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual const ConsumerId* getConsumerId() const;
         virtual ConsumerId* getConsumerId();
         virtual void setConsumerId( ConsumerId* consumerId );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/MessageDispatchNotification.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 
@@ -65,7 +66,7 @@
 void MessageDispatchNotification::copyDataStructure( const DataStructure* src ) {
 
     // Copy the data of the base class or classes
-    BaseCommand<transport::Command>::copyDataStructure( src );
+    BaseCommand::copyDataStructure( src );
 
     const MessageDispatchNotification* srcPtr = dynamic_cast<const MessageDispatchNotification*>( src );
 
@@ -124,7 +125,7 @@
     } else {
         stream << "   Object is NULL" << std::endl;
     }
-    stream << BaseCommand<transport::Command>::toString();
+    stream << BaseCommand::toString();
     stream << "End Class = MessageDispatchNotification" << std::endl;
 
     return stream.str();
@@ -161,13 +162,20 @@
     } else if( valuePtr->getMessageId() != NULL ) {
         return false;
     }
-    if( !BaseCommand<transport::Command>::equals( value ) ) {
+    if( !BaseCommand::equals( value ) ) {
         return false;
     }
     return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+commands::Command* MessageDispatchNotification::visit( activemq::state::CommandVisitor* visitor ) 
+    throw( exceptions::ActiveMQException ) {
+
+    return visitor->processMessageDispatchNotification( this );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 const ConsumerId* MessageDispatchNotification::getConsumerId() const {
     return consumerId;
 }

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.h?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.h Wed Jan 28 20:59:07 2009
@@ -44,7 +44,7 @@
      *         in the activemq-openwire-generator module
      *
      */
-    class AMQCPP_API MessageDispatchNotification : public BaseCommand<transport::Command> {
+    class AMQCPP_API MessageDispatchNotification : public BaseCommand {
     protected:
 
         ConsumerId* consumerId;
@@ -97,6 +97,16 @@
          */
         virtual bool equals( const DataStructure* value ) const;
 
+        /**
+         * Allows a Visitor to visit this command and return a response to the
+         * command based on the command type being visited.  The command will call
+         * the proper processXXX method in the visitor.
+         * 
+         * @return a Response to the visitor being called or NULL if no response.
+         */
+        virtual commands::Command* visit( activemq::state::CommandVisitor* visitor )
+            throw( exceptions::ActiveMQException );
+
         virtual const ConsumerId* getConsumerId() const;
         virtual ConsumerId* getConsumerId();
         virtual void setConsumerId( ConsumerId* consumerId );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.cpp?rev=738619&r1=738618&r2=738619&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.cpp Wed Jan 28 20:59:07 2009
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 #include <activemq/commands/MessageId.h>
+#include <activemq/state/CommandVisitor.h>
 #include <activemq/exceptions/ActiveMQException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 



Mime
View raw message