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/broker/Queue.cpp | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'cpp/src/qpid/broker/Queue.cpp') diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index d3a464a6fe..3b7461e094 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -105,19 +105,12 @@ Queue::Queue(const string& _name, bool _autodelete, broker(b), deleted(false) { - if (parent != 0 && broker != 0) - { + if (parent != 0 && broker != 0) { ManagementAgent* agent = broker->getManagementAgent(); - if (agent != 0) - { + if (agent != 0) { mgmtObject = new _qmf::Queue(agent, this, parent, _name, _store != 0, _autodelete, _owner != 0); - - // Add the object to the management agent only if this queue is not durable. - // If it's durable, we will add it later when the queue is assigned a persistenceId. - if (store == 0) { - agent->addObject (mgmtObject, agent->allocateId(this)); - } + agent->addObject(mgmtObject, 0, store != 0); } } } @@ -125,7 +118,7 @@ Queue::Queue(const string& _name, bool _autodelete, Queue::~Queue() { if (mgmtObject != 0) - mgmtObject->resourceDestroy (); + mgmtObject->resourceDestroy(); } bool isLocalTo(const OwnershipToken* token, boost::intrusive_ptr& msg) @@ -942,16 +935,11 @@ uint64_t Queue::getPersistenceId() const void Queue::setPersistenceId(uint64_t _persistenceId) const { - if (mgmtObject != 0 && persistenceId == 0) + if (mgmtObject != 0 && persistenceId == 0 && externalQueueStore) { - ManagementAgent* agent = broker->getManagementAgent(); - agent->addObject (mgmtObject, 0x3000000000000000LL + _persistenceId); - - if (externalQueueStore) { - ManagementObject* childObj = externalQueueStore->GetManagementObject(); - if (childObj != 0) - childObj->setReference(mgmtObject->getObjectId()); - } + ManagementObject* childObj = externalQueueStore->GetManagementObject(); + if (childObj != 0) + childObj->setReference(mgmtObject->getObjectId()); } persistenceId = _persistenceId; } -- cgit v1.2.1