Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 4789 invoked from network); 9 Feb 2009 20:15:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2009 20:15:43 -0000 Received: (qmail 6687 invoked by uid 500); 9 Feb 2009 20:15:43 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 6663 invoked by uid 500); 9 Feb 2009 20:15:43 -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 6654 invoked by uid 99); 9 Feb 2009 20:15:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 12:15:43 -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; Mon, 09 Feb 2009 20:15:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4BECC23888AF; Mon, 9 Feb 2009 20:15:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r742715 - in /activemq/activemq-cpp/trunk/src/main: activemq/commands/ activemq/core/ java/org/apache/activemq/openwire/tool/ Date: Mon, 09 Feb 2009 20:15:12 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090209201515.4BECC23888AF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Mon Feb 9 20:15:10 2009 New Revision: 742715 URL: http://svn.apache.org/viewvc?rev=742715&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-100 Flatten the Commands hierarchy further by removing the ActiveMQMessageBase class and having its code generated as part of the Message command making the rest of the code easier to write since we need to cast around to various message types less often. Removed: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessageBase.h Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessageTemplate.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/ConnectionControl.cpp 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/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/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/IntegerResponse.cpp activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.h activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.h 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/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/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/RemoveSubscriptionInfo.cpp activemq/activemq-cpp/trunk/src/main/activemq/commands/ReplayCommand.cpp activemq/activemq-cpp/trunk/src/main/activemq/commands/Response.cpp 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/ShutdownInfo.cpp activemq/activemq-cpp/trunk/src/main/activemq/commands/SubscriptionInfo.cpp activemq/activemq-cpp/trunk/src/main/activemq/commands/SubscriptionInfo.h 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/XATransactionId.cpp activemq/activemq-cpp/trunk/src/main/activemq/commands/srcmakefile.mk activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.cpp activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.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 Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessageTemplate.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessageTemplate.h?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessageTemplate.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ActiveMQMessageTemplate.h Mon Feb 9 20:15:10 2009 @@ -18,22 +18,25 @@ #ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQMESSAGETEMPLATE_H_ #define _ACTIVEMQ_COMMANDS_ACTIVEMQMESSAGETEMPLATE_H_ +#include #include -#include +#include +#include #include +#include namespace activemq { namespace commands { template< typename T > - class AMQCPP_API ActiveMQMessageTemplate : public T, public ActiveMQMessageBase { + class AMQCPP_API ActiveMQMessageTemplate : public T, public Message { private: std::auto_ptr propertiesInterceptor; public: - ActiveMQMessageTemplate() : ActiveMQMessageBase() { + ActiveMQMessageTemplate() : Message() { this->propertiesInterceptor.reset( new wireformat::openwire::utils::MessagePropertyInterceptor( this, &this->getMessageProperties() ) ); 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerId.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerId.cpp Mon Feb 9 20:15:10 2009 @@ -114,6 +114,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getValue() != valuePtr->getValue() ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/BrokerInfo.cpp Mon Feb 9 20:15:10 2009 @@ -151,6 +151,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getBrokerId() != NULL ) { if( !this->getBrokerId()->equals( valuePtr->getBrokerId().get() ) ) { return false; 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionControl.cpp Mon Feb 9 20:15:10 2009 @@ -120,6 +120,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->isClose() != valuePtr->isClose() ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.cpp Mon Feb 9 20:15:10 2009 @@ -119,6 +119,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getException() != NULL ) { if( !this->getException()->equals( valuePtr->getException().get() ) ) { return false; 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionError.h Mon Feb 9 20:15:10 2009 @@ -26,8 +26,8 @@ #include #include #include -#include #include +#include #include #include 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionId.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionId.cpp Mon Feb 9 20:15:10 2009 @@ -114,6 +114,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getValue() != valuePtr->getValue() ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.cpp Mon Feb 9 20:15:10 2009 @@ -139,6 +139,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getConnectionId() != NULL ) { if( !this->getConnectionId()->equals( valuePtr->getConnectionId().get() ) ) { return false; 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConnectionInfo.h Mon Feb 9 20:15:10 2009 @@ -26,8 +26,8 @@ #include #include #include -#include #include +#include #include #include 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerControl.cpp Mon Feb 9 20:15:10 2009 @@ -127,6 +127,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->isClose() != valuePtr->isClose() ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerId.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerId.cpp Mon Feb 9 20:15:10 2009 @@ -120,6 +120,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getConnectionId() != valuePtr->getConnectionId() ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.cpp Mon Feb 9 20:15:10 2009 @@ -174,6 +174,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getConsumerId() != NULL ) { if( !this->getConsumerId()->equals( valuePtr->getConsumerId().get() ) ) { return false; 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ConsumerInfo.h Mon Feb 9 20:15:10 2009 @@ -26,10 +26,10 @@ #include #include #include -#include -#include #include +#include #include +#include #include #include 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ControlCommand.cpp Mon Feb 9 20:15:10 2009 @@ -108,6 +108,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getCommand() != valuePtr->getCommand() ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DataArrayResponse.cpp Mon Feb 9 20:15:10 2009 @@ -114,6 +114,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + for( size_t idata = 0; idata < this->getData().size(); ++idata ) { if( this->getData()[idata] != NULL ) { if( !this->getData()[idata]->equals( valuePtr->getData()[idata].get() ) ) { 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DataResponse.cpp Mon Feb 9 20:15:10 2009 @@ -112,6 +112,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getData() != NULL ) { if( !this->getData()->equals( valuePtr->getData().get() ) ) { return false; 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.cpp Mon Feb 9 20:15:10 2009 @@ -134,6 +134,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getConnectionId() != NULL ) { if( !this->getConnectionId()->equals( valuePtr->getConnectionId().get() ) ) { return false; 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DestinationInfo.h Mon Feb 9 20:15:10 2009 @@ -26,9 +26,9 @@ #include #include #include +#include #include #include -#include #include #include 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/DiscoveryEvent.cpp Mon Feb 9 20:15:10 2009 @@ -111,6 +111,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getServiceName() != valuePtr->getServiceName() ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ExceptionResponse.cpp Mon Feb 9 20:15:10 2009 @@ -112,6 +112,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getException() != NULL ) { if( !this->getException()->equals( valuePtr->getException().get() ) ) { return false; 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/FlushCommand.cpp Mon Feb 9 20:15:10 2009 @@ -105,6 +105,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( !BaseCommand::equals( value ) ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/IntegerResponse.cpp Mon Feb 9 20:15:10 2009 @@ -108,6 +108,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getResult() != valuePtr->getResult() ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.cpp Mon Feb 9 20:15:10 2009 @@ -119,6 +119,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getDestination() != NULL ) { if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) { return false; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.h?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalQueueAck.h Mon Feb 9 20:15:10 2009 @@ -26,8 +26,8 @@ #include #include #include -#include #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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.cpp Mon Feb 9 20:15:10 2009 @@ -135,6 +135,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getDestination() != NULL ) { if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) { return false; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.h?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTopicAck.h Mon Feb 9 20:15:10 2009 @@ -26,9 +26,9 @@ #include #include #include -#include -#include #include +#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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTrace.cpp Mon Feb 9 20:15:10 2009 @@ -108,6 +108,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getMessage() != valuePtr->getMessage() ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/JournalTransaction.cpp Mon Feb 9 20:15:10 2009 @@ -118,6 +118,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getTransactionId() != NULL ) { if( !this->getTransactionId()->equals( valuePtr->getTransactionId().get() ) ) { return false; 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/KeepAliveInfo.cpp Mon Feb 9 20:15:10 2009 @@ -105,6 +105,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( !BaseCommand::equals( value ) ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/LastPartialCommand.cpp Mon Feb 9 20:15:10 2009 @@ -105,6 +105,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( !PartialCommand::equals( value ) ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/LocalTransactionId.cpp Mon Feb 9 20:15:10 2009 @@ -121,6 +121,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getValue() != valuePtr->getValue() ) { return false; } 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.cpp Mon Feb 9 20:15:10 2009 @@ -18,6 +18,8 @@ #include #include #include +#include +#include using namespace std; using namespace activemq; @@ -38,6 +40,7 @@ //////////////////////////////////////////////////////////////////////////////// Message::Message() { + this->ackHandler = NULL; this->groupID = ""; this->groupSequence = 0; this->correlationId = ""; @@ -89,6 +92,8 @@ __FILE__, __LINE__, "Message::copyDataStructure - src is NULL or invalid" ); } + this->properties.copy( srcPtr->properties ); + this->setAckHandler( srcPtr->getAckHandler() ); this->setProducerId( srcPtr->getProducerId() ); this->setDestination( srcPtr->getDestination() ); this->setTransactionId( srcPtr->getTransactionId() ); @@ -132,6 +137,8 @@ stream << "Begin Class = Message" << std::endl; stream << " Value of Message::ID_MESSAGE = 0" << std::endl; + stream << " Value of ackHandler = " << ackHandler << std::endl; + stream << " Value of properties = " << this->properties.toString() << std::endl; stream << " Value of ProducerId is Below:" << std::endl; if( this->getProducerId() != NULL ) { stream << this->getProducerId()->toString() << std::endl; @@ -242,6 +249,15 @@ if( valuePtr == NULL || value == NULL ) { return false; } + + if( ackHandler != valuePtr->getAckHandler() ){ + return false; + } + + if( !properties.equals( valuePtr->properties ) ) { + return false; + } + if( this->getProducerId() != NULL ) { if( !this->getProducerId()->equals( valuePtr->getProducerId().get() ) ) { return false; @@ -780,3 +796,35 @@ this->brokerOutTime = brokerOutTime; } +//////////////////////////////////////////////////////////////////////////////// + void Message::beforeMarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED ) + throw ( decaf::io::IOException ) { + + try{ + + marshalledProperties.clear(); + if( !properties.isEmpty() ) + { + wireformat::openwire::marshal::PrimitiveMapMarshaller::marshal( + &properties, marshalledProperties ); + } + } + AMQ_CATCH_RETHROW( decaf::io::IOException ) + AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, decaf::io::IOException ) + AMQ_CATCHALL_THROW( decaf::io::IOException ) + } + +//////////////////////////////////////////////////////////////////////////////// + void Message::afterUnmarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED ) + throw ( decaf::io::IOException ) { + + try{ + + wireformat::openwire::marshal::PrimitiveMapMarshaller::unmarshal( + &properties, marshalledProperties ); + } + AMQ_CATCH_RETHROW( decaf::io::IOException ) + AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, decaf::io::IOException ) + AMQ_CATCHALL_THROW( decaf::io::IOException ) + } + 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.h Mon Feb 9 20:15:10 2009 @@ -25,22 +25,23 @@ #include #include +#include +#include #include -#include -#include +#include #include -#include +#include #include -#include +#include #include #include -#include -#include -#include #include #include namespace activemq{ +namespace core{ + class ActiveMQAckHandler; +} namespace commands{ /* @@ -54,6 +55,16 @@ * */ class AMQCPP_API Message : public BaseCommand { + private: + + // Used to allow a client to call Message::acknowledge when in the Client + // Ack mode. + core::ActiveMQAckHandler* ackHandler; + + // Message properties, these are Marshaled and Unmarshaled from the Message + // Command's marshaledProperties vector. + activemq::util::PrimitiveMap properties; + protected: static const unsigned int DEFAULT_MESSAGE_SIZE = 1024; @@ -139,12 +150,83 @@ virtual bool equals( const DataStructure* value ) const; /** + * Handles the marshaling of the objects properties into the + * internal byte array before the object is marshaled to the + * wire + * @param wireFormat - the wireformat controller + */ + virtual void beforeMarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED ) + throw ( decaf::io::IOException ); + + /** + * Called after unmarshaling is started to cleanup the object being + * unmarshaled. + * @param wireFormat - the wireformat object to control unmarshaling + */ + virtual void afterUnmarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED ) + throw ( decaf::io::IOException ); + + /** + * Indicates that this command is aware of Marshaling, and needs + * to have its Marshaling methods invoked. + * @returns boolean indicating desire to be in marshaling stages + */ + virtual bool isMarshalAware() const { + return true; + } + + /** + * Sets the Acknowledgment Handler that this Message will use + * when the Acknowledge method is called. + * @param handler ActiveMQAckHandler to call + */ + virtual void setAckHandler( core::ActiveMQAckHandler* handler ) { + this->ackHandler = handler; + } + + /** + * Gets the Acknowledgment Handler that this Message will use + * when the Acknowledge method is called. + * @returns handler ActiveMQAckHandler to call or NULL if not set + */ + virtual core::ActiveMQAckHandler* getAckHandler() const { + return this->ackHandler; + } + + /** * Returns the Size of this message in Bytes. * @returns number of bytes this message equates to. */ virtual unsigned int getSize() const; /** + * Returns if this message has expired, meaning that its + * Expiration time has elapsed. + * @returns true if message is expired. + */ + virtual bool isExpired() const { + long long expireTime = this->getExpiration(); + long long currentTime = decaf::util::Date::getCurrentTimeMilliseconds(); + if( expireTime > 0 && currentTime > expireTime ) { + return true; + } + return false; + } + + /** + * Gets a reference to the Message's Properties object, allows the derived + * classes to get and set their own specific properties. + * + * @return a reference to the Primitive Map that holds message properties. + */ + util::PrimitiveMap& getMessageProperties() { + return this->properties; + } + const util::PrimitiveMap& getMessageProperties() const { + return this->properties; + } + + /** * 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. 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.cpp Mon Feb 9 20:15:10 2009 @@ -146,6 +146,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getDestination() != NULL ) { if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) { return false; 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.h Mon Feb 9 20:15:10 2009 @@ -26,11 +26,10 @@ #include #include #include -#include #include -#include -#include #include +#include +#include #include #include 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.cpp Mon Feb 9 20:15:10 2009 @@ -129,6 +129,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getConsumerId() != NULL ) { if( !this->getConsumerId()->equals( valuePtr->getConsumerId().get() ) ) { return false; 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.h Mon Feb 9 20:15:10 2009 @@ -27,8 +27,8 @@ #include #include #include -#include #include +#include #include #include 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.cpp Mon Feb 9 20:15:10 2009 @@ -129,6 +129,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getConsumerId() != NULL ) { if( !this->getConsumerId()->equals( valuePtr->getConsumerId().get() ) ) { return false; 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.h Mon Feb 9 20:15:10 2009 @@ -26,9 +26,9 @@ #include #include #include +#include #include #include -#include #include #include 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=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.cpp Mon Feb 9 20:15:10 2009 @@ -124,6 +124,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getProducerId() != NULL ) { if( !this->getProducerId()->equals( valuePtr->getProducerId().get() ) ) { return false; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.cpp Mon Feb 9 20:15:10 2009 @@ -132,6 +132,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getConsumerId() != NULL ) { if( !this->getConsumerId()->equals( valuePtr->getConsumerId().get() ) ) { return false; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.h?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.h Mon Feb 9 20:15:10 2009 @@ -26,9 +26,9 @@ #include #include #include +#include #include #include -#include #include #include Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.cpp Mon Feb 9 20:15:10 2009 @@ -115,6 +115,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getNetworkTTL() != valuePtr->getNetworkTTL() ) { return false; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.cpp Mon Feb 9 20:15:10 2009 @@ -112,6 +112,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getCommandId() != valuePtr->getCommandId() ) { return false; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.cpp Mon Feb 9 20:15:10 2009 @@ -115,6 +115,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getProducerId() != NULL ) { if( !this->getProducerId()->equals( valuePtr->getProducerId().get() ) ) { return false; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.cpp Mon Feb 9 20:15:10 2009 @@ -120,6 +120,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getConnectionId() != valuePtr->getConnectionId() ) { return false; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.cpp Mon Feb 9 20:15:10 2009 @@ -134,6 +134,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getProducerId() != NULL ) { if( !this->getProducerId()->equals( valuePtr->getProducerId().get() ) ) { return false; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.h?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.h Mon Feb 9 20:15:10 2009 @@ -26,9 +26,9 @@ #include #include #include +#include #include #include -#include #include #include Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.cpp Mon Feb 9 20:15:10 2009 @@ -112,6 +112,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getObjectId() != NULL ) { if( !this->getObjectId()->equals( valuePtr->getObjectId().get() ) ) { return false; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.cpp Mon Feb 9 20:15:10 2009 @@ -118,6 +118,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getConnectionId() != NULL ) { if( !this->getConnectionId()->equals( valuePtr->getConnectionId().get() ) ) { return false; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ReplayCommand.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ReplayCommand.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ReplayCommand.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ReplayCommand.cpp Mon Feb 9 20:15:10 2009 @@ -111,6 +111,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getFirstNakNumber() != valuePtr->getFirstNakNumber() ) { return false; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/Response.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/Response.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/Response.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/Response.cpp Mon Feb 9 20:15:10 2009 @@ -108,6 +108,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getCorrelationId() != valuePtr->getCorrelationId() ) { return false; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/SessionId.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/SessionId.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/SessionId.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/SessionId.cpp Mon Feb 9 20:15:10 2009 @@ -117,6 +117,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getConnectionId() != valuePtr->getConnectionId() ) { return false; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/SessionInfo.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/SessionInfo.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/SessionInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/SessionInfo.cpp Mon Feb 9 20:15:10 2009 @@ -112,6 +112,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getSessionId() != NULL ) { if( !this->getSessionId()->equals( valuePtr->getSessionId().get() ) ) { return false; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ShutdownInfo.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ShutdownInfo.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ShutdownInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ShutdownInfo.cpp Mon Feb 9 20:15:10 2009 @@ -105,6 +105,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( !BaseCommand::equals( value ) ) { return false; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/SubscriptionInfo.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/SubscriptionInfo.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/SubscriptionInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/SubscriptionInfo.cpp Mon Feb 9 20:15:10 2009 @@ -128,6 +128,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getClientId() != valuePtr->getClientId() ) { return false; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/SubscriptionInfo.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/SubscriptionInfo.h?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/SubscriptionInfo.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/SubscriptionInfo.h Mon Feb 9 20:15:10 2009 @@ -27,7 +27,6 @@ #include #include #include -#include #include #include Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionId.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionId.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionId.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionId.cpp Mon Feb 9 20:15:10 2009 @@ -111,6 +111,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( !BaseDataStructure::equals( value ) ) { return false; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionInfo.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionInfo.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionInfo.cpp Mon Feb 9 20:15:10 2009 @@ -122,6 +122,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getConnectionId() != NULL ) { if( !this->getConnectionId()->equals( valuePtr->getConnectionId().get() ) ) { return false; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionInfo.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionInfo.h?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionInfo.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/TransactionInfo.h Mon Feb 9 20:15:10 2009 @@ -26,8 +26,8 @@ #include #include #include -#include #include +#include #include #include Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/XATransactionId.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/XATransactionId.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/XATransactionId.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/XATransactionId.cpp Mon Feb 9 20:15:10 2009 @@ -122,6 +122,7 @@ if( valuePtr == NULL || value == NULL ) { return false; } + if( this->getFormatId() != valuePtr->getFormatId() ) { return false; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/srcmakefile.mk URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/srcmakefile.mk?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/srcmakefile.mk (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/srcmakefile.mk Mon Feb 9 20:15:10 2009 @@ -84,7 +84,6 @@ activemq/commands/ActiveMQDestination.h \ activemq/commands/ActiveMQMapMessage.h \ activemq/commands/ActiveMQMessage.h \ - activemq/commands/ActiveMQMessageBase.h \ activemq/commands/ActiveMQMessageTemplate.h \ activemq/commands/ActiveMQObjectMessage.h \ activemq/commands/ActiveMQQueue.h \ Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.cpp?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.cpp Mon Feb 9 20:15:10 2009 @@ -176,7 +176,7 @@ decaf::lang::Pointer message = data.getMessage(); // If it's expired, process the message and then go back to waiting. - if( dynamic_cast( message.get() )->isExpired() ) { + if( message->isExpired() ) { beforeMessageIsConsumed( message ); afterMessageIsConsumed( message, true ); @@ -349,7 +349,7 @@ // Register ourself so that we can handle the Message's // acknowledge method. - dynamic_cast( message.get() )->setAckHandler( this ); + message->setAckHandler( this ); } // If the session is transacted then we hand off the message to it to @@ -455,7 +455,7 @@ decaf::lang::Pointer message = data.getMessage(); // Don't dispatch expired messages, ack it and then destroy it - if( dynamic_cast( message.get() )->isExpired() ) { + if( message.get()->isExpired() ) { this->acknowledge( message.get(), ActiveMQConstants::ACK_TYPE_CONSUMED ); // stop now, don't queue Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.h?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConsumer.h Mon Feb 9 20:15:10 2009 @@ -25,7 +25,6 @@ #include #include #include -#include #include #include Modified: activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java (original) +++ activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java Mon Feb 9 20:15:10 2009 @@ -164,9 +164,16 @@ out.println("#include "); out.println("#include "); out.println("#include "); + + if( className.equals( "Message" ) ) { +out.println("#include "); +out.println("#include "); + } + if( comparable ) { out.println("#include "); } + out.println(""); out.println("using namespace std;"); out.println("using namespace activemq;"); @@ -188,6 +195,10 @@ out.println(""+className+"::"+className+"() {"); out.println(""); + if( className.equals( "Message" ) ) { +out.println(" this->ackHandler = NULL;"); + } + List properties = getProperties(); for (Iterator iter = properties.iterator(); iter.hasNext();) { JProperty property = (JProperty) iter.next(); @@ -214,26 +225,6 @@ out.println("////////////////////////////////////////////////////////////////////////////////"); out.println(""+className+"::~"+className+"() {"); out.println(""); - -// for( Iterator iter = properties.iterator(); iter.hasNext(); ) { -// JProperty property = (JProperty) iter.next(); -// String type = toCppType(property.getType()); -// String propertyName = property.getSimpleName(); -// String parameterName = decapitalize(propertyName); -// -// if( property.getType().isPrimitiveType() || -// property.getType().getSimpleName().equals("String") ) { -// continue; -// } -// -// if( !type.startsWith("std::vector" ) ) { -//out.println(" delete this->" + parameterName + ";"); -// } else if( type.contains( "*" ) ) { -//out.println(" for( size_t i" + parameterName + " = 0; i" + parameterName + " < " + parameterName + ".size(); ++i" + parameterName + " ) {"); -//out.println(" delete " + parameterName + "[i" + parameterName + "];"); -//out.println(" }"); -// } -// } out.println("}"); out.println(""); @@ -274,50 +265,18 @@ out.println(" \""+className+"::copyDataStructure - src is NULL or invalid\" );"); out.println(" }"); - for( Iterator iter = properties.iterator(); iter.hasNext(); ) { - JProperty property = (JProperty) iter.next(); - String type = toCppType(property.getType()); - String propertyName = property.getSimpleName(); - String parameterName = decapitalize(propertyName); - String constNess = ""; - String getter = property.getGetter().getSimpleName(); - String setter = property.getSetter().getSimpleName(); - -// if( property.getType().isPrimitiveType() || -// type.equals("std::string") || -// property.getType().getSimpleName().equals("ByteSequence") ){ + if( className.equals( "Message" ) ) { +out.println(" this->properties.copy( srcPtr->properties );"); +out.println(" this->setAckHandler( srcPtr->getAckHandler() );"); + } -out.println(" this->"+setter+"( srcPtr->"+getter+"() );"); + for( Iterator iter = properties.iterator(); iter.hasNext(); ) { + JProperty property = (JProperty) iter.next(); + String getter = property.getGetter().getSimpleName(); + String setter = property.getSetter().getSimpleName(); -// } else if( property.getType().isArrayType() && -// !property.getType().getArrayComponentType().isPrimitiveType() ) { -// -// String arrayType = property.getType().getArrayComponentType().getSimpleName(); -// -//out.println(" for( size_t i" + parameterName + " = 0; i" + parameterName + " < srcPtr->"+getter+"().size(); ++i" + parameterName + " ) {"); -//out.println(" if( srcPtr->"+getter+"()[i"+parameterName+"] != NULL ) {"); -//out.println(" this->"+getter+"().push_back("); -//out.println(" dynamic_cast<"+arrayType+"*>("); -//out.println(" srcPtr->"+getter+"()[i"+parameterName+"]->cloneDataStructure() ) );"); -//out.println(" } else {"); -//out.println(" this->"+getter+"().push_back( NULL );"); -//out.println(" }"); -//out.println(" }"); -// -// } else if( property.getType().isArrayType() && -// property.getType().getArrayComponentType().isPrimitiveType() ) { -// -//out.println(" this->"+setter+"( srcPtr->"+getter+"() );"); -// -// } else { -// -//out.println(" if( srcPtr->"+getter+"() != NULL ) {"); -//out.println(" this->"+setter+"("); -//out.println(" dynamic_cast<"+type+"*>("); -//out.println(" srcPtr->"+getter+"()->cloneDataStructure() ) );"); -//out.println(" }"); - } -// } +out.println(" this->"+setter+"( srcPtr->"+getter+"() );"); + } out.println("}"); out.println(""); @@ -335,6 +294,11 @@ out.println(" stream << \"Begin Class = "+className+"\" << std::endl;" ); out.println(" stream << \" Value of "+className+"::ID_" + className.toUpperCase() + " = "+getOpenWireOpCode(jclass)+"\" << std::endl;"); + if( className.equals( "Message" ) ) { +out.println(" stream << \" Value of ackHandler = \" << ackHandler << std::endl;"); +out.println(" stream << \" Value of properties = \" << this->properties.toString() << std::endl;"); + } + for( Iterator iter = properties.iterator(); iter.hasNext(); ) { JProperty property = (JProperty) iter.next(); String type = toCppType(property.getType()); @@ -412,6 +376,18 @@ out.println(" if( valuePtr == NULL || value == NULL ) {"); out.println(" return false;"); out.println(" }"); +out.println(""); + + if( className.equals( "Message" ) ) { +out.println(" if( ackHandler != valuePtr->getAckHandler() ){"); +out.println(" return false;"); +out.println(" }"); +out.println(""); +out.println(" if( !properties.equals( valuePtr->properties ) ) {"); +out.println(" return false;"); +out.println(" }"); +out.println(""); + } for( Iterator iter = properties.iterator(); iter.hasNext(); ) { JProperty property = (JProperty) iter.next(); @@ -517,14 +493,12 @@ type = "decaf::lang::Pointer<" + type + ">&"; constNess = "const "; -// type = type + "*"; } else if( property.getType().getSimpleName().equals("String") || type.startsWith( "std::vector") ) { type = type + "&"; constNess = "const "; } - out.println(""); if( property.getType().isPrimitiveType() ) { @@ -630,6 +604,42 @@ out.println("}"); out.println(""); } + + if( className.equals( "Message" ) ) { + +out.println("////////////////////////////////////////////////////////////////////////////////"); +out.println(" void Message::beforeMarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED )"); +out.println(" throw ( decaf::io::IOException ) {"); +out.println(""); +out.println(" try{"); +out.println(""); +out.println(" marshalledProperties.clear();"); +out.println(" if( !properties.isEmpty() )"); +out.println(" {"); +out.println(" wireformat::openwire::marshal::PrimitiveMapMarshaller::marshal("); +out.println(" &properties, marshalledProperties );"); +out.println(" }"); +out.println(" }"); +out.println(" AMQ_CATCH_RETHROW( decaf::io::IOException )"); +out.println(" AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, decaf::io::IOException )"); +out.println(" AMQ_CATCHALL_THROW( decaf::io::IOException )"); +out.println(" }"); +out.println(""); +out.println("////////////////////////////////////////////////////////////////////////////////"); +out.println(" void Message::afterUnmarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED )"); +out.println(" throw ( decaf::io::IOException ) {"); +out.println(""); +out.println(" try{"); +out.println(""); +out.println(" wireformat::openwire::marshal::PrimitiveMapMarshaller::unmarshal("); +out.println(" &properties, marshalledProperties );"); +out.println(" }"); +out.println(" AMQ_CATCH_RETHROW( decaf::io::IOException )"); +out.println(" AMQ_CATCH_EXCEPTION_CONVERT( decaf::lang::Exception, decaf::io::IOException )"); +out.println(" AMQ_CATCHALL_THROW( decaf::io::IOException )"); +out.println(" }"); +out.println(""); + } } public String getTargetDir() { Modified: activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java?rev=742715&r1=742714&r2=742715&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java (original) +++ activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppHeadersGenerator.java Mon Feb 9 20:15:10 2009 @@ -20,6 +20,8 @@ import java.io.PrintWriter; import java.util.Iterator; import java.util.List; +import java.util.Set; +import java.util.HashSet; import org.codehaus.jam.JClass; import org.codehaus.jam.JProperty; @@ -52,30 +54,43 @@ out.println(""); out.println("#include "); out.println("#include "); + if( className.equals( "Message" ) ) { +out.println("#include "); +out.println("#include "); + } out.println("#include "); if( comparable ) { out.println("#include "); } -List properties = getProperties(); -for (Iterator iter = properties.iterator(); iter.hasNext();) { - JProperty property = (JProperty) iter.next(); - if( !property.getType().isPrimitiveType() && - !property.getType().getSimpleName().equals("String") && - !property.getType().getSimpleName().equals("ByteSequence") ) - { - String includeName = toHeaderFileName( property.getType() ); - if( includeName != null ) { - out.println("#include "); + List properties = getProperties(); + Set includeNames = new HashSet(); + for (Iterator iter = properties.iterator(); iter.hasNext();) { + JProperty property = (JProperty) iter.next(); + if( !property.getType().isPrimitiveType() && + !property.getType().getSimpleName().equals("String") && + !property.getType().getSimpleName().equals("ByteSequence") ) + { + includeNames.add( toHeaderFileName( property.getType() ) ); + } + } + + for( String includeName : includeNames ) { + if( includeName != null ) { + out.println("#include "); + } } - } -} out.println("#include "); out.println("#include "); out.println(""); out.println("namespace activemq{"); + if( className.equals( "Message" ) ) { +out.println("namespace core{"); +out.println(" class ActiveMQAckHandler;"); +out.println("}"); + } out.println("namespace commands{"); out.println(""); out.println(" /*"); @@ -96,6 +111,20 @@ out.print("public "+ baseClass +" {" ); out.println(""); } + + if( className.equals( "Message" ) ) { +out.println(" private:"); +out.println(""); +out.println(" // Used to allow a client to call Message::acknowledge when in the Client"); +out.println(" // Ack mode."); +out.println(" core::ActiveMQAckHandler* ackHandler;"); +out.println(""); +out.println(" // Message properties, these are Marshaled and Unmarshaled from the Message"); +out.println(" // Command's marshaledProperties vector."); +out.println(" activemq::util::PrimitiveMap properties;"); +out.println(""); + } + out.println(" protected:"); out.println(""); @@ -189,11 +218,82 @@ if( className.equals( "Message" ) ) { out.println(" /**"); +out.println(" * Handles the marshaling of the objects properties into the"); +out.println(" * internal byte array before the object is marshaled to the"); +out.println(" * wire"); +out.println(" * @param wireFormat - the wireformat controller"); +out.println(" */"); +out.println(" virtual void beforeMarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED )"); +out.println(" throw ( decaf::io::IOException );"); +out.println(""); +out.println(" /**"); +out.println(" * Called after unmarshaling is started to cleanup the object being"); +out.println(" * unmarshaled."); +out.println(" * @param wireFormat - the wireformat object to control unmarshaling"); +out.println(" */"); +out.println(" virtual void afterUnmarshal( wireformat::WireFormat* wireFormat AMQCPP_UNUSED )"); +out.println(" throw ( decaf::io::IOException );"); +out.println(""); +out.println(" /**"); +out.println(" * Indicates that this command is aware of Marshaling, and needs"); +out.println(" * to have its Marshaling methods invoked."); +out.println(" * @returns boolean indicating desire to be in marshaling stages"); +out.println(" */"); +out.println(" virtual bool isMarshalAware() const {"); +out.println(" return true;"); +out.println(" }"); +out.println(""); +out.println(" /**"); +out.println(" * Sets the Acknowledgment Handler that this Message will use"); +out.println(" * when the Acknowledge method is called."); +out.println(" * @param handler ActiveMQAckHandler to call"); +out.println(" */"); +out.println(" virtual void setAckHandler( core::ActiveMQAckHandler* handler ) {"); +out.println(" this->ackHandler = handler;"); +out.println(" }"); +out.println(""); +out.println(" /**"); +out.println(" * Gets the Acknowledgment Handler that this Message will use"); +out.println(" * when the Acknowledge method is called."); +out.println(" * @returns handler ActiveMQAckHandler to call or NULL if not set"); +out.println(" */"); +out.println(" virtual core::ActiveMQAckHandler* getAckHandler() const {"); +out.println(" return this->ackHandler;"); +out.println(" }"); +out.println(""); +out.println(" /**"); out.println(" * Returns the Size of this message in Bytes."); out.println(" * @returns number of bytes this message equates to."); out.println(" */"); out.println(" virtual unsigned int getSize() const;"); out.println(""); +out.println(" /**"); +out.println(" * Returns if this message has expired, meaning that its"); +out.println(" * Expiration time has elapsed."); +out.println(" * @returns true if message is expired."); +out.println(" */"); +out.println(" virtual bool isExpired() const {"); +out.println(" long long expireTime = this->getExpiration();"); +out.println(" long long currentTime = decaf::util::Date::getCurrentTimeMilliseconds();"); +out.println(" if( expireTime > 0 && currentTime > expireTime ) {"); +out.println(" return true;"); +out.println(" }"); +out.println(" return false;"); +out.println(" }"); +out.println(""); +out.println(" /**"); +out.println(" * Gets a reference to the Message's Properties object, allows the derived"); +out.println(" * classes to get and set their own specific properties."); +out.println(" *"); +out.println(" * @return a reference to the Primitive Map that holds message properties."); +out.println(" */"); +out.println(" util::PrimitiveMap& getMessageProperties() {"); +out.println(" return this->properties;"); +out.println(" }"); +out.println(" const util::PrimitiveMap& getMessageProperties() const {"); +out.println(" return this->properties;"); +out.println(" }"); +out.println(""); }