summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/QueueRegistry.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-01-18 22:08:29 +0000
committerAlan Conway <aconway@apache.org>2012-01-18 22:08:29 +0000
commit893a3834c13c7ee7fa2c6b4aadb8585bb13e1fa7 (patch)
tree27ef2cc03e4139023dda3e8303fc66656a0257ed /cpp/src/qpid/broker/QueueRegistry.cpp
parentbcd082b3fd874f74755bc67d193027769aecd1ef (diff)
downloadqpid-python-893a3834c13c7ee7fa2c6b4aadb8585bb13e1fa7.tar.gz
QPID-3603: Consistent find/get functions for Queue and Exchange registries.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1233084 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/QueueRegistry.cpp')
-rw-r--r--cpp/src/qpid/broker/QueueRegistry.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/QueueRegistry.cpp b/cpp/src/qpid/broker/QueueRegistry.cpp
index 135a3543d9..236d5ae34c 100644
--- a/cpp/src/qpid/broker/QueueRegistry.cpp
+++ b/cpp/src/qpid/broker/QueueRegistry.cpp
@@ -23,6 +23,7 @@
#include "qpid/broker/QueueEvents.h"
#include "qpid/broker/Exchange.h"
#include "qpid/log/Statement.h"
+#include "qpid/framing/reply_exceptions.h"
#include <sstream>
#include <assert.h>
@@ -84,7 +85,6 @@ void QueueRegistry::destroy (const string& name){
Queue::shared_ptr QueueRegistry::find(const string& name){
RWlock::ScopedRlock locker(lock);
QueueMap::iterator i = queues.find(name);
-
if (i == queues.end()) {
return Queue::shared_ptr();
} else {
@@ -92,6 +92,12 @@ Queue::shared_ptr QueueRegistry::find(const string& name){
}
}
+Queue::shared_ptr QueueRegistry::get(const string& name) {
+ Queue::shared_ptr q = find(name);
+ if (!q) throw framing::NotFoundException(QPID_MSG("Queue not found: "<<name));
+ return q;
+}
+
string QueueRegistry::generateName(){
string name;
do {