diff options
author | Alan Conway <aconway@apache.org> | 2012-06-08 15:24:30 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2012-06-08 15:24:30 +0000 |
commit | ea0c222a318baf1cd71eb363f1244e04ca3c74de (patch) | |
tree | 4af3254114f350d7ea80751b63ae599ccd622b17 /qpid/cpp/src/qpid/broker/QueueRegistry.cpp | |
parent | ba3b6c53f4072744aecbac429c8eab66631d84c6 (diff) | |
download | qpid-python-ea0c222a318baf1cd71eb363f1244e04ca3c74de.tar.gz |
QPID-3603: Add ConfigurationObserver.
Allows plugins to observe configuration events queue create/destroy,
exchange create/destroy and bind/unbind.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1348114 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/broker/QueueRegistry.cpp')
-rw-r--r-- | qpid/cpp/src/qpid/broker/QueueRegistry.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/broker/QueueRegistry.cpp b/qpid/cpp/src/qpid/broker/QueueRegistry.cpp index 236d5ae34c..6647774168 100644 --- a/qpid/cpp/src/qpid/broker/QueueRegistry.cpp +++ b/qpid/cpp/src/qpid/broker/QueueRegistry.cpp @@ -18,6 +18,7 @@ * under the License. * */ +#include "qpid/broker/Broker.h" #include "qpid/broker/Queue.h" #include "qpid/broker/QueueRegistry.h" #include "qpid/broker/QueueEvents.h" @@ -64,17 +65,22 @@ QueueRegistry::declare(const string& declareName, bool durable, //i.e. recovering a queue for which we already have a persistent record queue->configure(arguments); } + if (broker) broker->getConfigurationObservers().queueCreate(queue); queues[name] = queue; if (lastNode) queue->setLastNodeFailure(); - return std::pair<Queue::shared_ptr, bool>(queue, true); } else { return std::pair<Queue::shared_ptr, bool>(i->second, false); } } -void QueueRegistry::destroyLH (const string& name){ - queues.erase(name); +void QueueRegistry::destroyLH (const string& name) { + QueueMap::iterator i = queues.find(name); + if (i != queues.end()) { + Queue::shared_ptr q = i->second; + queues.erase(i); + if (broker) broker->getConfigurationObservers().queueDestroy(q); + } } void QueueRegistry::destroy (const string& name){ |