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 | cd7956c780ef1d7829dc42e9802c1f3a060b1185 (patch) | |
| tree | f3278038dbb37f2c96884fd6acf4b43dd85d2292 /cpp/src/qpid/broker/QueueRegistry.cpp | |
| parent | 276e39fc35e6186e8f676c506e461da759b37a9a (diff) | |
| download | qpid-python-cd7956c780ef1d7829dc42e9802c1f3a060b1185.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/qpid@1348114 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/QueueRegistry.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/QueueRegistry.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/QueueRegistry.cpp b/cpp/src/qpid/broker/QueueRegistry.cpp index 236d5ae34c..6647774168 100644 --- a/cpp/src/qpid/broker/QueueRegistry.cpp +++ b/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){ |
