From 761e10501fe5ea51f9d8c40d9a200ae27193ab23 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 31 Aug 2007 20:51:22 +0000 Subject: * Summary: - Moved BrokerChannel functionality into Session. - Moved ChannelHandler methods handling into SessionAdapter. - Updated all handlers to use session. (We're still using AMQP channel methods in SessionAdapter) Roles & responsibilities: Session: - represents an _open_ session, may be active or suspended. - ows all session state including handler chains. - attahced to SessionAdapter when active, not when suspended. SessionAdapter: - reprents the association of a channel with a session. - owned by Connection, kept in the session map. - channel open == SessionAdapter.getSessio() != 0 Anything that depends on attachment to a channel, connection or protocol should be in SessionAdpater. Anything that suvives a session suspend belongs in Session. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@571575 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/SessionManager.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cpp/src/qpid/cluster/SessionManager.cpp') diff --git a/cpp/src/qpid/cluster/SessionManager.cpp b/cpp/src/qpid/cluster/SessionManager.cpp index f001da7ea4..dc14b24905 100644 --- a/cpp/src/qpid/cluster/SessionManager.cpp +++ b/cpp/src/qpid/cluster/SessionManager.cpp @@ -25,7 +25,6 @@ #include "qpid/framing/AMQP_ServerOperations.h" #include "qpid/broker/BrokerAdapter.h" #include "qpid/broker/Connection.h" -#include "qpid/broker/BrokerChannel.h" #include "qpid/framing/ChannelAdapter.h" #include @@ -38,13 +37,13 @@ using namespace sys; using namespace broker; /** Handler to send frames direct to local broker (bypass correlation etc.) */ -struct SessionManager::BrokerHandler : - public FrameHandler, private ChannelAdapter, private DeliveryAdapter +struct SessionManager::BrokerHandler : public FrameHandler, private ChannelAdapter { Connection connection; - Channel channel; + SessionAdapter sessionAdapter; + broker::Session session; BrokerAdapter adapter; - + // TODO aconway 2007-07-23: Lots of needless flab here (Channel, // Connection, ChannelAdapter) As these classes are untangled the // flab can be reduced. The real requirements are: @@ -55,8 +54,9 @@ struct SessionManager::BrokerHandler : // BrokerHandler(Broker& broker) : connection(0, broker), - channel(connection, *this, 1), - adapter(channel, connection, broker, *this) {} + sessionAdapter(connection, 0), + session(sessionAdapter, 1), + adapter(session, static_cast(*this)) {} void handle(AMQFrame& frame) { AMQMethodBody* body=dynamic_cast(frame.getBody()); -- cgit v1.2.1