summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SessionHandlerImpl.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2006-11-03 13:44:21 +0000
committerGordon Sim <gsim@apache.org>2006-11-03 13:44:21 +0000
commit15a915878c787e6d5ed8330a8dd4375ec885a6c0 (patch)
treee580dbbeb7c61c4dc1a1348156c1970e09311b10 /cpp/src/qpid/broker/SessionHandlerImpl.cpp
parent20b96a39f539bf5181a58d1235f521d6a544bc47 (diff)
downloadqpid-python-15a915878c787e6d5ed8330a8dd4375ec885a6c0.tar.gz
Added some methods to MessageStore interface and hooked these in where appropriate.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@470810 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SessionHandlerImpl.cpp')
-rw-r--r--cpp/src/qpid/broker/SessionHandlerImpl.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/SessionHandlerImpl.cpp b/cpp/src/qpid/broker/SessionHandlerImpl.cpp
index 7c94a65d73..7a03132671 100644
--- a/cpp/src/qpid/broker/SessionHandlerImpl.cpp
+++ b/cpp/src/qpid/broker/SessionHandlerImpl.cpp
@@ -250,24 +250,28 @@ void SessionHandlerImpl::QueueHandlerImpl::declare(u_int16_t channel, u_int16_t
queue = parent->getQueue(name, channel);
} else {
std::pair<Queue::shared_ptr, bool> queue_created =
- parent->queues->declare(name, durable, autoDelete ? parent->timeout : 0, 0, exclusive ? parent : 0);
+ parent->queues->declare(name, durable, autoDelete ? parent->timeout : 0, exclusive ? parent : 0);
queue = queue_created.first;
assert(queue);
if (queue_created.second) { // This is a new queue
parent->getChannel(channel)->setDefaultQueue(queue);
+
+ //create persistent record if required
+ queue_created.first->create();
+
//add default binding:
parent->exchanges->getDefault()->bind(queue, name, 0);
- if(exclusive){
+ if (exclusive) {
parent->exclusiveQueues.push_back(queue);
} else if(autoDelete){
parent->cleaner->add(queue);
}
}
}
- if(exclusive && !queue->isExclusiveOwner(parent)){
+ if (exclusive && !queue->isExclusiveOwner(parent)) {
throw ChannelException(405, "Cannot grant exclusive access to queue");
}
- if(!nowait){
+ if (!nowait) {
name = queue->getName();
parent->client.getQueue().declareOk(channel, name, queue->getMessageCount(), queue->getConsumerCount());
}
@@ -311,6 +315,7 @@ void SessionHandlerImpl::QueueHandlerImpl::delete_(u_int16_t channel, u_int16_t
if(i < parent->exclusiveQueues.end()) parent->exclusiveQueues.erase(i);
}
count = q->getMessageCount();
+ q->destroy();
parent->queues->destroy(queue);
}
if(!nowait) parent->client.getQueue().deleteOk(channel, count);