activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r739139 - in /activemq/activemq-cpp/trunk/src/main/activemq/state: CommandVisitorAdapter.h ConnectionState.h SessionState.h
Date Fri, 30 Jan 2009 01:59:29 GMT
Author: tabish
Date: Fri Jan 30 01:59:29 2009
New Revision: 739139

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

More implementation of the state package.

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/state/CommandVisitorAdapter.h
    activemq/activemq-cpp/trunk/src/main/activemq/state/ConnectionState.h
    activemq/activemq-cpp/trunk/src/main/activemq/state/SessionState.h

Modified: activemq/activemq-cpp/trunk/src/main/activemq/state/CommandVisitorAdapter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/state/CommandVisitorAdapter.h?rev=739139&r1=739138&r2=739139&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/state/CommandVisitorAdapter.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/state/CommandVisitorAdapter.h Fri Jan 30
01:59:29 2009
@@ -21,6 +21,7 @@
 #include <activemq/util/Config.h>
 
 #include <activemq/state/CommandVisitor.h>
+#include <activemq/core/ActiveMQConstants.h>
 
 #include <activemq/commands/ConnectionInfo.h>
 #include <activemq/commands/SessionInfo.h>
@@ -67,237 +68,279 @@
 
         virtual ~CommandVisitorAdapter() {}
 
-        virtual commands::Command* processTransactionInfo(
-            commands::TransactionInfo* info ) throw ( exceptions::ActiveMQException ) {
-
-            return NULL;
-        }
-
-        virtual commands::Command* processConnectionInfo(
-            commands::ConnectionInfo* info ) throw ( exceptions::ActiveMQException ) {
-
-            return NULL;
-        }
-
-        virtual commands::Command* processSessionInfo(
-            commands::SessionInfo* info ) throw ( exceptions::ActiveMQException ) {
-
-            return NULL;
-        }
-
-        virtual commands::Command* processProducerInfo(
-            commands::ProducerInfo* info ) throw ( exceptions::ActiveMQException ) {
-
-            return NULL;
-        }
-
-        virtual commands::Command* processConsumerInfo(
-            commands::ConsumerInfo* info ) throw ( exceptions::ActiveMQException ) {
-
-            return NULL;
-        }
-
         virtual commands::Command* processRemoveConnection(
-            commands::ConnectionId* id ) throw ( exceptions::ActiveMQException ) {
+            commands::ConnectionId* id AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processRemoveSession(
-            commands::SessionId* id ) throw ( exceptions::ActiveMQException ) {
+            commands::SessionId* id AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processRemoveProducer(
-            commands::ProducerId* id ) throw ( exceptions::ActiveMQException ) {
+            commands::ProducerId* id AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processRemoveConsumer(
-            commands::ConsumerId* id ) throw ( exceptions::ActiveMQException ) {
+            commands::ConsumerId* id AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processDestinationInfo(
-            commands::DestinationInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::DestinationInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processRemoveDestination(
-            commands::DestinationInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::DestinationInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processRemoveSubscriptionInfo(
-            commands::RemoveSubscriptionInfo* info ) throw ( exceptions::ActiveMQException
) {
+            commands::RemoveSubscriptionInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processMessage(
-            commands::Message* send ) throw ( exceptions::ActiveMQException ) {
+            commands::Message* send AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processMessageAck(
-            commands::MessageAck* ack ) throw ( exceptions::ActiveMQException ) {
+            commands::MessageAck* ack AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processMessagePull(
-            commands::MessagePull* pull ) throw ( exceptions::ActiveMQException ) {
+            commands::MessagePull* pull AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processBeginTransaction(
-            commands::TransactionInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::TransactionInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processPrepareTransaction(
-            commands::TransactionInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::TransactionInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processCommitTransactionOnePhase(
-            commands::TransactionInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::TransactionInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processCommitTransactionTwoPhase(
-            commands::TransactionInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::TransactionInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processRollbackTransaction(
-            commands::TransactionInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::TransactionInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processWireFormat(
-            commands::WireFormatInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::WireFormatInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processKeepAliveInfo(
-            commands::KeepAliveInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::KeepAliveInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processShutdownInfo(
-            commands::ShutdownInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::ShutdownInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processFlushCommand(
-            commands::FlushCommand* command ) throw ( exceptions::ActiveMQException ) {
+            commands::FlushCommand* command AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processBrokerInfo(
-            commands::BrokerInfo* info) throw ( exceptions::ActiveMQException ) {
+            commands::BrokerInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processRecoverTransactions(
-            commands::TransactionInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::TransactionInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processForgetTransaction(
-            commands::TransactionInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::TransactionInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processEndTransaction(
-            commands::TransactionInfo* info ) throw ( exceptions::ActiveMQException ) {
+            commands::TransactionInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processMessageDispatchNotification(
-            commands::MessageDispatchNotification* notification ) throw ( exceptions::ActiveMQException
) {
+            commands::MessageDispatchNotification* notification AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processProducerAck(
-            commands::ProducerAck* ack ) throw ( exceptions::ActiveMQException ) {
+            commands::ProducerAck* ack AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processMessageDispatch(
-            commands::MessageDispatch* dispatch ) throw ( exceptions::ActiveMQException )
{
+            commands::MessageDispatch* dispatch AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processControlCommand(
-            commands::ControlCommand* command ) throw ( exceptions::ActiveMQException ) {
+            commands::ControlCommand* command AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processConnectionError(
-            commands::ConnectionError* error ) throw ( exceptions::ActiveMQException ) {
+            commands::ConnectionError* error AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processConnectionControl(
-            commands::ConnectionControl* control ) throw ( exceptions::ActiveMQException
) {
+            commands::ConnectionControl* control AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processConsumerControl(
-            commands::ConsumerControl* control ) throw ( exceptions::ActiveMQException )
{
+            commands::ConsumerControl* control AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
         virtual commands::Command* processBrokerError(
-            commands::BrokerError* error ) throw ( exceptions::ActiveMQException ) {
+            commands::BrokerError* error AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
-        virtual commands::Command* processRemoveInfo(
-            commands::RemoveInfo* info ) throw ( exceptions::ActiveMQException ) {
+        virtual commands::Command* processReplayCommand(
+            commands::ReplayCommand* replay AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
-        virtual commands::Command* processReplayCommand(
-            commands::ReplayCommand* replay ) throw ( exceptions::ActiveMQException ) {
+        virtual commands::Command* processResponse(
+            commands::Response* response AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
 
             return NULL;
         }
 
-        virtual commands::Command* processResponse(
-            commands::Response* response ) throw ( exceptions::ActiveMQException ) {
+        virtual commands::Command* processConnectionInfo(
+            commands::ConnectionInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
+
+            return NULL;
+        }
+
+        virtual commands::Command* processSessionInfo(
+            commands::SessionInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
+
+            return NULL;
+        }
+
+        virtual commands::Command* processProducerInfo(
+            commands::ProducerInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
+
+            return NULL;
+        }
+
+        virtual commands::Command* processConsumerInfo(
+            commands::ConsumerInfo* info AMQCPP_UNUSED ) throw ( exceptions::ActiveMQException
) {
+
+            return NULL;
+        }
+
+        virtual commands::Command* processTransactionInfo(
+            commands::TransactionInfo* info ) throw ( exceptions::ActiveMQException ) {
+
+            if( info != NULL ) {
+                switch( info->getType() ) {
+                    case core::ActiveMQConstants::TRANSACTION_STATE_BEGIN:
+                        return this->processBeginTransaction( info );
+                    case core::ActiveMQConstants::TRANSACTION_STATE_COMMITONEPHASE:
+                        return this->processCommitTransactionOnePhase( info );
+                    case core::ActiveMQConstants::TRANSACTION_STATE_COMMITTWOPHASE:
+                        return this->processCommitTransactionTwoPhase( info );
+                    case core::ActiveMQConstants::TRANSACTION_STATE_END:
+                        return this->processEndTransaction( info );
+                    case core::ActiveMQConstants::TRANSACTION_STATE_FORGET:
+                        return this->processForgetTransaction( info );
+                    case core::ActiveMQConstants::TRANSACTION_STATE_PREPARE:
+                        return this->processPrepareTransaction( info );
+                    case core::ActiveMQConstants::TRANSACTION_STATE_RECOVER:
+                        return this->processRecoverTransactions( info );
+                    case core::ActiveMQConstants::TRANSACTION_STATE_ROLLBACK:
+                        return this->processRollbackTransaction( info );
+                    default:
+                        throw exceptions::ActiveMQException(
+                            __FILE__, __LINE__, "Unknown Transaction Info Type.");
+                }
+            }
+            return NULL;
+        }
+
+        virtual commands::Command* processRemoveInfo(
+            commands::RemoveInfo* info ) throw ( exceptions::ActiveMQException ) {
 
+            if( info != NULL ) {
+                switch( info->getObjectId()->getDataStructureType() ) {
+                    case commands::ConnectionId::ID_CONNECTIONID:
+                        return this->processRemoveConnection(
+                            dynamic_cast<commands::ConnectionId*>( info->getObjectId()
) );
+                    case commands::SessionId::ID_SESSIONID:
+                        return this->processRemoveSession(
+                            dynamic_cast<commands::SessionId*>( info->getObjectId()
) );
+                    case commands::ConsumerId::ID_CONSUMERID:
+                        return this->processRemoveConsumer(
+                            dynamic_cast<commands::ConsumerId*>( info->getObjectId()
) );
+                    case commands::ProducerId::ID_PRODUCERID:
+                        return this->processRemoveProducer(
+                            dynamic_cast<commands::ProducerId*>( info->getObjectId()
) );
+                    default:
+                        throw exceptions::ActiveMQException(
+                            __FILE__, __LINE__, "Unknown Remove Info Type.");
+                }
+            }
             return NULL;
         }
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/state/ConnectionState.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/state/ConnectionState.h?rev=739139&r1=739138&r2=739139&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/state/ConnectionState.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/state/ConnectionState.h Fri Jan 30 01:59:29
2009
@@ -44,8 +44,8 @@
     private:
 
         std::auto_ptr<commands::ConnectionInfo> info;
-        decaf::util::Map< commands::TransactionId*, TransactionState* > transactions;
-        decaf::util::Map< commands::SessionId*, SessionState* > sessions;
+        decaf::util::Map< commands::TransactionId, TransactionState* > transactions;
+        decaf::util::Map< commands::SessionId, SessionState* > sessions;
         decaf::util::List< commands::DestinationInfo* > tempDestinations;
         decaf::util::concurrent::atomic::AtomicBoolean disposed;
 

Modified: activemq/activemq-cpp/trunk/src/main/activemq/state/SessionState.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/state/SessionState.h?rev=739139&r1=739138&r2=739139&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/state/SessionState.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/state/SessionState.h Fri Jan 30 01:59:29
2009
@@ -38,8 +38,8 @@
     private:
 
         std::auto_ptr<commands::SessionInfo> info;
-        decaf::util::Map< commands::ProducerId*, ProducerState* > producers;
-        decaf::util::Map< commands::ConsumerId*, ConsumerState* > consumers;
+        decaf::util::Map< commands::ProducerId, ProducerState* > producers;
+        decaf::util::Map< commands::ConsumerId, ConsumerState* > consumers;
         decaf::util::concurrent::atomic::AtomicBoolean disposed;
 
     public:



Mime
View raw message