summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-02-26 08:40:13 +0000
committerGordon Sim <gsim@apache.org>2008-02-26 08:40:13 +0000
commitcba1dfa2cb3315d9b0aae2900172fafa2e3961da (patch)
tree0b8a6882a4cd4b78baf2a434fd1b1f9665154dc0 /cpp/src
parent1a8807f7219689eaa1fcf8ce1bd96de9fe287b95 (diff)
downloadqpid-python-cba1dfa2cb3315d9b0aae2900172fafa2e3961da.tar.gz
Use sessions reference to broker rather than connections in semantic state as the sessions ref is valid even when not attached.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@631128 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/broker/SemanticState.cpp6
-rw-r--r--cpp/src/qpid/broker/SessionContext.h1
2 files changed, 4 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp
index c6c0ae5440..9b44f31e14 100644
--- a/cpp/src/qpid/broker/SemanticState.cpp
+++ b/cpp/src/qpid/broker/SemanticState.cpp
@@ -326,7 +326,7 @@ void SemanticState::cancel(ConsumerImpl& c)
if(queue) {
queue->cancel(c);
if (queue->canAutoDelete() && !queue->hasExclusiveOwner()) {
- Queue::tryAutoDelete(getSession().getConnection().getBroker(), queue);
+ Queue::tryAutoDelete(session.getBroker(), queue);
}
}
}
@@ -347,7 +347,7 @@ void SemanticState::route(intrusive_ptr<Message> msg, Deliverable& strategy) {
std::string exchangeName = msg->getExchangeName();
msg->getProperties<DeliveryProperties>()->setExchange(exchangeName);
if (!cacheExchange || cacheExchange->getName() != exchangeName){
- cacheExchange = session.getConnection().broker.getExchanges().get(exchangeName);
+ cacheExchange = session.getBroker().getExchanges().get(exchangeName);
}
cacheExchange->route(strategy, msg->getRoutingKey(), msg->getApplicationHeaders());
@@ -579,7 +579,7 @@ Queue::shared_ptr SemanticState::getQueue(const string& name) const {
if (name.empty()) {
throw NotAllowedException(QPID_MSG("No queue name specified."));
} else {
- queue = session.getConnection().getBroker().getQueues().find(name);
+ queue = session.getBroker().getQueues().find(name);
if (!queue)
throw NotFoundException(QPID_MSG("Queue not found: "<<name));
}
diff --git a/cpp/src/qpid/broker/SessionContext.h b/cpp/src/qpid/broker/SessionContext.h
index 63dd02cede..a289310b15 100644
--- a/cpp/src/qpid/broker/SessionContext.h
+++ b/cpp/src/qpid/broker/SessionContext.h
@@ -40,6 +40,7 @@ class SessionContext : public sys::OutputControl
virtual ~SessionContext(){}
virtual ConnectionState& getConnection() = 0;
virtual framing::AMQP_ClientProxy& getProxy() = 0;
+ virtual Broker& getBroker() = 0;
};
}} // namespace qpid::broker