From ce41c9d094746451b674bebe5edb4e61116e77c2 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Fri, 23 Apr 2010 21:00:10 +0000 Subject: Code cleanup - Removed IdAllocator (it's no longer needed) - Cleaned up the calls to ManagementAgent::addObject to handle durable objects - Removed the deferred call to addObject for durable objects - Removed unneeded calls to self._checkClosed() in qmf.console.Agent git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@937516 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/ClusterPlugin.cpp | 47 ---------------------------------- 1 file changed, 47 deletions(-) (limited to 'cpp/src/qpid/cluster/ClusterPlugin.cpp') diff --git a/cpp/src/qpid/cluster/ClusterPlugin.cpp b/cpp/src/qpid/cluster/ClusterPlugin.cpp index 3192896956..955487ee03 100644 --- a/cpp/src/qpid/cluster/ClusterPlugin.cpp +++ b/cpp/src/qpid/cluster/ClusterPlugin.cpp @@ -32,7 +32,6 @@ #include "qpid/log/Statement.h" #include "qpid/management/ManagementAgent.h" -#include "qpid/management/IdAllocator.h" #include "qpid/broker/Exchange.h" #include "qpid/broker/Message.h" #include "qpid/broker/Queue.h" @@ -48,7 +47,6 @@ namespace cluster { using namespace std; using broker::Broker; -using management::IdAllocator; using management::ManagementAgent; @@ -77,46 +75,6 @@ struct ClusterOptions : public Options { } }; -struct UpdateClientIdAllocator : management::IdAllocator -{ - qpid::sys::AtomicValue sequence; - - UpdateClientIdAllocator() : sequence(0x4000000000000000LL) {} - - uint64_t getIdFor(management::Manageable* m) - { - if (isUpdateQueue(m) || isUpdateExchange(m) || isUpdateSession(m) || isUpdateBinding(m)) { - return ++sequence; - } else { - return 0; - } - } - - bool isUpdateQueue(management::Manageable* manageable) - { - qpid::broker::Queue* queue = dynamic_cast(manageable); - return queue && queue->getName() == UpdateClient::UPDATE; - } - - bool isUpdateExchange(management::Manageable* manageable) - { - qpid::broker::Exchange* exchange = dynamic_cast(manageable); - return exchange && exchange->getName() == UpdateClient::UPDATE; - } - - bool isUpdateSession(management::Manageable* manageable) - { - broker::SessionState* session = dynamic_cast(manageable); - return session && session->getId().getName() == UpdateClient::UPDATE; - } - - bool isUpdateBinding(management::Manageable* manageable) - { - broker::Exchange::Binding* binding = dynamic_cast(manageable); - return binding && binding->queue->getName() == UpdateClient::UPDATE; - } -}; - struct ClusterPlugin : public Plugin { ClusterSettings settings; @@ -139,11 +97,6 @@ struct ClusterPlugin : public Plugin { broker->setConnectionFactory( boost::shared_ptr( new ConnectionCodec::Factory(broker->getConnectionFactory(), *cluster))); - ManagementAgent* mgmt = broker->getManagementAgent(); - if (mgmt) { - std::auto_ptr allocator(new UpdateClientIdAllocator()); - mgmt->setAllocator(allocator); - } } void disallowManagementMethods(ManagementAgent* agent) { -- cgit v1.2.1