From 6aeb03f0f5ac7ede957995fc784367a30920c683 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 18 Sep 2007 19:43:29 +0000 Subject: Refactor HandlerImpl to use Session rather than CoreRefs. Remove most uses of ChannelAdapter in broker code. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@577027 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Session.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'cpp/src/qpid/broker/Session.cpp') diff --git a/cpp/src/qpid/broker/Session.cpp b/cpp/src/qpid/broker/Session.cpp index 6bc96b0049..c59119140c 100644 --- a/cpp/src/qpid/broker/Session.cpp +++ b/cpp/src/qpid/broker/Session.cpp @@ -68,11 +68,9 @@ Session::Session(SessionHandler& a, uint32_t t) flowActive(true) { outstanding.reset(); - // FIXME aconway 2007-08-29: handler to get Session, not connection. std::auto_ptr semantic(new SemanticHandler(*this)); + // FIXME aconway 2007-08-29: move deliveryAdapter to SemanticHandlerState. deliveryAdapter=semantic.get(); - // FIXME aconway 2007-08-31: Remove, workaround. - semanticHandler=semantic.get(); handlers.push_back(semantic.release()); in = &handlers[0]; out = &adapter->out; @@ -256,7 +254,7 @@ Session::ConsumerImpl::ConsumerImpl(Session* _parent, bool Session::ConsumerImpl::deliver(QueuedMessage& msg) { - if (nolocal && &parent->getAdapter()->getConnection() == msg.payload->getPublisher()) { + if (nolocal && &parent->getHandler()->getConnection() == msg.payload->getPublisher()) { return false; } else { if (!checkCredit(msg.payload) || !parent->flowActive || (ackExpected && !parent->checkPrefetch(msg.payload))) { @@ -306,7 +304,7 @@ void Session::ConsumerImpl::cancel() if(queue) { queue->cancel(this); if (queue->canAutoDelete()) { - parent->getAdapter()->getConnection().broker.getQueues().destroyIf(queue->getName(), + parent->getHandler()->getConnection().broker.getQueues().destroyIf(queue->getName(), boost::bind(boost::mem_fn(&Queue::canAutoDelete), queue)); } } @@ -333,7 +331,7 @@ void Session::handle(Message::shared_ptr msg) { void Session::route(Message::shared_ptr msg, Deliverable& strategy) { std::string exchangeName = msg->getExchangeName(); if (!cacheExchange || cacheExchange->getName() != exchangeName){ - cacheExchange = getAdapter()->getConnection().broker.getExchanges().get(exchangeName); + cacheExchange = getHandler()->getConnection().broker.getExchanges().get(exchangeName); } cacheExchange->route(strategy, msg->getRoutingKey(), msg->getApplicationHeaders()); -- cgit v1.2.1