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/SessionHandler.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/SessionHandler.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/SessionHandler.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/SessionHandler.cpp b/cpp/src/qpid/broker/SessionHandler.cpp index 13e5c247be..ecbffed465 100644 --- a/cpp/src/qpid/broker/SessionHandler.cpp +++ b/cpp/src/qpid/broker/SessionHandler.cpp @@ -35,7 +35,7 @@ SessionHandler::SessionHandler(Connection& c, ChannelId ch) connection(c), channel(ch), proxy(out), ignoring(false) {} -SessionHandler::~SessionHandler() {} +SessionHandler::~SessionHandler() { } namespace { ClassId classId(AMQMethodBody* m) { return m ? m->amqpMethodId() : 0; } @@ -53,7 +53,7 @@ void SessionHandler::handleIn(AMQFrame& f) { try { if (m && m->invoke(this)) return; - else if (session) + else if (session.get()) session->in(f); else if (!ignoring) throw ChannelErrorException( @@ -76,7 +76,7 @@ void SessionHandler::handleOut(AMQFrame& f) { } void SessionHandler::assertOpen(const char* method) { - if (!session) + if (!session.get()) throw ChannelErrorException( QPID_MSG(""<<method<<" failed: No session for channel " << getChannel())); @@ -85,7 +85,7 @@ void SessionHandler::assertOpen(const char* method) { void SessionHandler::assertClosed(const char* method) { // FIXME aconway 2007-08-31: Should raise channel-busy, need // to update spec. - if (session) + if (session.get()) throw PreconditionFailedException( QPID_MSG(""<<method<<" failed: " << channel << " already open on channel " @@ -94,7 +94,9 @@ void SessionHandler::assertClosed(const char* method) { void SessionHandler::open(uint32_t detachedLifetime) { assertClosed("open"); - session.reset(new SessionState(*this, detachedLifetime)); + std::auto_ptr<SessionState> state( + connection.broker.getSessionManager().open(*this, detachedLifetime)); + session.reset(state.release()); getProxy().getSession().attached(session->getId(), session->getTimeout()); } |
