diff options
| author | Gordon Sim <gsim@apache.org> | 2009-01-23 21:55:15 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2009-01-23 21:55:15 +0000 |
| commit | b849efb083c88de6c1932d0f7a87a7c500dbd3d6 (patch) | |
| tree | 727bdbdb8c3701d90a0d31e2f3e42b26d10c9f9d /cpp/src/qpid/broker/Queue.cpp | |
| parent | 85428cec6a090c58c34453dee8b38ac20a619a96 (diff) | |
| download | qpid-python-b849efb083c88de6c1932d0f7a87a7c500dbd3d6.tar.gz | |
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
Diffstat (limited to 'cpp/src/qpid/broker/Queue.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/Queue.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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<ManagementBroker*>(agent); + agent->addObject (mgmtObject, mb ? mb->allocateId(this) : 0); + } } } } |
