00001 #ifndef QPID_BROKER_SESSIONHANDLER_H
00002 #define QPID_BROKER_SESSIONHANDLER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "qpid/amqp_0_10/SessionHandler.h"
00026 #include "qpid/framing/AMQP_ClientProxy.h"
00027
00028 namespace qpid {
00029 class SessionState;
00030
00031 namespace broker {
00032
00033 class Connection;
00034 class ConnectionState;
00035 class SessionState;
00036
00042 class SessionHandler : public amqp_0_10::SessionHandler {
00043 public:
00044 SessionHandler(Connection&, framing::ChannelId);
00045 ~SessionHandler();
00046
00048 SessionState* getSession() { return session.get(); }
00049 const SessionState* getSession() const { return session.get(); }
00050
00051 ConnectionState& getConnection();
00052 const ConnectionState& getConnection() const;
00053
00054 framing::AMQP_ClientProxy& getProxy() { return proxy; }
00055 const framing::AMQP_ClientProxy& getProxy() const { return proxy; }
00056
00057 virtual void handleDetach();
00058
00059
00060 void attached(const std::string& name);
00061
00062 protected:
00063 virtual void setState(const std::string& sessionName, bool force);
00064 virtual qpid::SessionState* getState();
00065 virtual framing::FrameHandler* getInHandler();
00066 virtual void channelException(uint16_t code, const std::string& msg);
00067 virtual void connectionException(uint16_t code, const std::string& msg);
00068 virtual void readyToSend();
00069
00070 private:
00071 Connection& connection;
00072 framing::AMQP_ClientProxy proxy;
00073 std::auto_ptr<SessionState> session;
00074 };
00075
00076 }}
00077
00078
00079
00080 #endif