summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/QueueRegistry.cpp
diff options
context:
space:
mode:
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 {