Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 60300 invoked from network); 28 Jan 2009 20:59:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jan 2009 20:59:46 -0000 Received: (qmail 34414 invoked by uid 500); 28 Jan 2009 20:59:45 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 34296 invoked by uid 500); 28 Jan 2009 20:59:45 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 34277 invoked by uid 99); 28 Jan 2009 20:59:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jan 2009 12:59:45 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jan 2009 20:59:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6B64F23888AF; Wed, 28 Jan 2009 20:59:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090128205916.6B64F23888AF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 #include +#include #include #include #include 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 +#include + 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 -#include -#include -#include +#include 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( 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* command = - dynamic_cast< const BaseCommand* >( 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 #include -#include #include #include 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 +#include +#include +#include + +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( 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( + 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 { + 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( 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( - 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 +#include #include #include 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 +#include #include #include @@ -73,7 +74,7 @@ void BrokerInfo::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const BrokerInfo* srcPtr = dynamic_cast( 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::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::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 { + 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 +#include +#include +#include + +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 +#include #include #include @@ -63,7 +64,7 @@ void ConnectionControl::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const ConnectionControl* srcPtr = dynamic_cast( 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::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::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 { + 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 +#include #include #include @@ -62,7 +63,7 @@ void ConnectionError::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const ConnectionError* srcPtr = dynamic_cast( src ); @@ -108,7 +109,7 @@ } else { stream << " Object is NULL" << std::endl; } - stream << BaseCommand::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::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 { + 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 +#include #include #include 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 +#include #include #include @@ -69,7 +70,7 @@ void ConnectionInfo::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const ConnectionInfo* srcPtr = dynamic_cast( 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::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::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 { + 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 +#include #include #include @@ -65,7 +66,7 @@ void ConsumerControl::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const ConsumerControl* srcPtr = dynamic_cast( 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::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::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 { + 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 +#include #include #include 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 +#include #include #include @@ -80,7 +81,7 @@ void ConsumerInfo::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const ConsumerInfo* srcPtr = dynamic_cast( 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::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::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 { + 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 +#include #include #include @@ -59,7 +60,7 @@ void ControlCommand::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const ControlCommand* srcPtr = dynamic_cast( 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::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::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 { + 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 +#include #include #include 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 +#include #include #include 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 +#include #include #include @@ -67,7 +68,7 @@ void DestinationInfo::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const DestinationInfo* srcPtr = dynamic_cast( src ); @@ -134,7 +135,7 @@ stream << " Object is NULL" << std::endl; } } - stream << BaseCommand::toString(); + stream << BaseCommand::toString(); stream << "End Class = DestinationInfo" << std::endl; return stream.str(); @@ -176,13 +177,20 @@ return false; } } - if( !BaseCommand::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 { + 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 +#include #include #include 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 +#include #include #include 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 +#include #include #include @@ -58,7 +59,7 @@ void FlushCommand::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const FlushCommand* srcPtr = dynamic_cast( src ); @@ -82,7 +83,7 @@ stream << "Begin Class = FlushCommand" << std::endl; stream << " Value of FlushCommand::ID_FLUSHCOMMAND = 15" << std::endl; - stream << BaseCommand::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::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 { + 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 +#include #include #include 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 +#include #include #include 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 +#include #include #include 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 +#include #include #include 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 +#include #include #include 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 +#include #include #include @@ -58,7 +59,7 @@ void KeepAliveInfo::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const KeepAliveInfo* srcPtr = dynamic_cast( src ); @@ -82,7 +83,7 @@ stream << "Begin Class = KeepAliveInfo" << std::endl; stream << " Value of KeepAliveInfo::ID_KEEPALIVEINFO = 10" << std::endl; - stream << BaseCommand::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::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 { + 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 +#include #include #include 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 +#include #include #include 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 +#include #include #include @@ -98,7 +99,7 @@ void Message::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const Message* srcPtr = dynamic_cast( src ); @@ -295,7 +296,7 @@ } stream << " Value of BrokerInTime = " << this->getBrokerInTime() << std::endl; stream << " Value of BrokerOutTime = " << this->getBrokerOutTime() << std::endl; - stream << BaseCommand::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::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 { + 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 +#include #include #include @@ -70,7 +71,7 @@ void MessageAck::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const MessageAck* srcPtr = dynamic_cast( src ); @@ -153,7 +154,7 @@ stream << " Object is NULL" << std::endl; } stream << " Value of MessageCount = " << this->getMessageCount() << std::endl; - stream << BaseCommand::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::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 { + 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 +#include #include #include @@ -65,7 +66,7 @@ void MessageDispatch::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const MessageDispatch* srcPtr = dynamic_cast( src ); @@ -124,7 +125,7 @@ stream << " Object is NULL" << std::endl; } stream << " Value of RedeliveryCounter = " << this->getRedeliveryCounter() << std::endl; - stream << BaseCommand::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::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 { + 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 +#include #include #include @@ -65,7 +66,7 @@ void MessageDispatchNotification::copyDataStructure( const DataStructure* src ) { // Copy the data of the base class or classes - BaseCommand::copyDataStructure( src ); + BaseCommand::copyDataStructure( src ); const MessageDispatchNotification* srcPtr = dynamic_cast( src ); @@ -124,7 +125,7 @@ } else { stream << " Object is NULL" << std::endl; } - stream << BaseCommand::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::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 { + 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 +#include #include #include