From b3992a21f76f38797723f70168ecda6be21e3719 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 24 Sep 2007 21:15:46 +0000 Subject: 2007-09-24 Alan Conway * cpp/src/qpid/broker/SessionManager.cpp: Manage suspended sessions. Replaces SuspendedSessions. * cpp/src/qpid/broker/SessionState.cpp: Work with SessionManager. * cpp/src/qpid/broker/SessionHandler.cpp: Owns SessionState. * cpp/src/qpid/broker/Connection.h, .cpp: Owns session handlers. * cpp/src/qpid/broker/Broker.h: Added SessionManager member. * cpp/src/Makefile.am: Added broker/SessionManager.cpp * amqp.0-10-preview.xml: Added session-busy and channel-busy constants. * cpp/src/tests/.valgrind.supp-default: Added suppresssions for F7. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@578975 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SessionState.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'cpp/src/qpid/broker/SessionState.cpp') diff --git a/cpp/src/qpid/broker/SessionState.cpp b/cpp/src/qpid/broker/SessionState.cpp index acfb3bfea8..b56aa106a3 100644 --- a/cpp/src/qpid/broker/SessionState.cpp +++ b/cpp/src/qpid/broker/SessionState.cpp @@ -19,18 +19,20 @@ * */ #include "SessionState.h" +#include "SessionManager.h" #include "SessionHandler.h" #include "Connection.h" #include "Broker.h" #include "SemanticHandler.h" +#include "qpid/framing/reply_exceptions.h" namespace qpid { namespace broker { using namespace framing; -SessionState::SessionState(SessionHandler& h, uint32_t timeout_) - : handler(&h), id(true), timeout(timeout_), +SessionState::SessionState(SessionManager& f, SessionHandler& h, uint32_t timeout_) + : factory(f), handler(&h), id(true), timeout(timeout_), broker(h.getConnection().broker), version(h.getConnection().getVersion()) { @@ -45,6 +47,11 @@ SessionState::SessionState(SessionHandler& h, uint32_t timeout_) broker.update(handler->getChannel(), *this); } +SessionState::~SessionState() { + // Remove ID from active session list. + factory.active.erase(getId()); +} + SessionHandler& SessionState::getHandler() { assert(isAttached()); return *handler; @@ -53,9 +60,7 @@ SessionHandler& SessionState::getHandler() { AMQP_ClientProxy& SessionState::getProxy() { return getHandler().getProxy(); } - /** Convenience for: getHandler()->getConnection() - *@pre getHandler() != 0 - */ + Connection& SessionState::getConnection() { return getHandler().getConnection(); } -- cgit v1.2.1