From b849efb083c88de6c1932d0f7a87a7c500dbd3d6 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 23 Jan 2009 21:55:15 +0000 Subject: Use special management ids for objects used in state transfer to new members. This prevents the ids getting out of sync across the cluster and allows management methods to be used reliably. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@737203 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Queue.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 962b463571..d459c64c54 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -30,6 +30,7 @@ #include "qpid/StringUtils.h" #include "qpid/log/Statement.h" +#include "qpid/management/ManagementBroker.h" #include "qpid/framing/reply_exceptions.h" #include "qpid/sys/Monitor.h" #include "qpid/sys/Time.h" @@ -46,6 +47,7 @@ using namespace qpid::broker; using namespace qpid::sys; using namespace qpid::framing; using qpid::management::ManagementAgent; +using qpid::management::ManagementBroker; using qpid::management::ManagementObject; using qpid::management::Manageable; using qpid::management::Args; @@ -103,8 +105,10 @@ Queue::Queue(const string& _name, bool _autodelete, // 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); + if (store == 0) { + ManagementBroker* mb = dynamic_cast(agent); + agent->addObject (mgmtObject, mb ? mb->allocateId(this) : 0); + } } } } -- cgit v1.2.1