diff options
| author | Alan Conway <aconway@apache.org> | 2007-09-24 21:15:46 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-09-24 21:15:46 +0000 |
| commit | b3992a21f76f38797723f70168ecda6be21e3719 (patch) | |
| tree | 9654292603c8b2bc31d5685e8f965b4713352f72 /cpp/src/qpid/broker/SessionState.cpp | |
| parent | 96c24e0cd7359cfb2fb026c742cbd1b2d23a0015 (diff) | |
| download | qpid-python-b3992a21f76f38797723f70168ecda6be21e3719.tar.gz | |
2007-09-24 Alan Conway <aconway@redhat.com>
* 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
Diffstat (limited to 'cpp/src/qpid/broker/SessionState.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/SessionState.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
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(); } |
