From 8b82aef0397d65de0c7278476e4f409fcc636306 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 28 Sep 2007 16:21:34 +0000 Subject: * src/tests/ClientSessionTest.cpp: Suspend/resume tests. * broker/SessionManager.cpp, broker/SessionHandler.cpp: Implement suspend/resume * client/ScopedAssociation.h, SessionCore.h, SessionHandler.h: Simplified relationships. - Removed ScopedAssociation. - SessionHandler: is now a member of SessionCore. - SessionCore: shared_ptr ownership by Session(s) and ConnectionImpl. - Using framing::FrameHandler interfaces. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@580403 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SessionHandler.cpp | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'cpp/src/qpid/broker/SessionHandler.cpp') diff --git a/cpp/src/qpid/broker/SessionHandler.cpp b/cpp/src/qpid/broker/SessionHandler.cpp index ecbffed465..d7308572f9 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; } @@ -78,18 +78,15 @@ void SessionHandler::handleOut(AMQFrame& f) { void SessionHandler::assertOpen(const char* method) { if (!session.get()) throw ChannelErrorException( - QPID_MSG(""<getId(), session->getTimeout()); } +void SessionHandler::resume(const Uuid& id) { + assertClosed("resume"); + session = connection.broker.getSessionManager().resume(*this, id); + getProxy().getSession().attached(session->getId(), session->getTimeout()); +} + void SessionHandler::flow(bool /*active*/) { // FIXME aconway 2007-09-19: Removed in 0-10, remove assert(0); throw NotImplementedException(); @@ -115,26 +118,23 @@ void SessionHandler::close() { ignoring=false; session.reset(); getProxy().getSession().closed(REPLY_SUCCESS, "ok"); - // No need to remove from connection map, will be re-used - // if channel is re-opened. + assert(&connection.getChannel(channel) == this); + connection.closeChannel(channel); } void SessionHandler::closed(uint16_t replyCode, const string& replyText) { - // FIXME aconway 2007-08-31: Extend constants.h to map codes & ids - // to text names. QPID_LOG(warning, "Received session.closed: "<