diff options
author | Alan Conway <aconway@apache.org> | 2007-09-28 16:21:34 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-09-28 16:21:34 +0000 |
commit | 8b82aef0397d65de0c7278476e4f409fcc636306 (patch) | |
tree | a25d9bbb01203335bc1450a5e5ed0c29074913ae /cpp/src/qpid/client/SessionHandler.h | |
parent | f689c47486b4cfc7655e37da2b232fe27be1cc42 (diff) | |
download | qpid-python-8b82aef0397d65de0c7278476e4f409fcc636306.tar.gz |
* 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
Diffstat (limited to 'cpp/src/qpid/client/SessionHandler.h')
-rw-r--r-- | cpp/src/qpid/client/SessionHandler.h | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/cpp/src/qpid/client/SessionHandler.h b/cpp/src/qpid/client/SessionHandler.h index e71d527406..994b8402de 100644 --- a/cpp/src/qpid/client/SessionHandler.h +++ b/cpp/src/qpid/client/SessionHandler.h @@ -22,36 +22,40 @@ #define _SessionHandler_ #include "StateManager.h" -#include "ChainableFrameHandler.h" +#include "qpid/framing/FrameHandler.h" #include "qpid/framing/amqp_framing.h" +#include "qpid/framing/Uuid.h" +#include "qpid/shared_ptr.h" namespace qpid { namespace client { +class SessionCore; -class SessionHandler : private StateManager, public ChainableFrameHandler +/** + * Handles incoming session (L2) commands. + */ +class SessionHandler : public framing::FrameHandler, + private StateManager { - enum STATES {OPENING, OPEN, CLOSING, CLOSED, CLOSED_BY_PEER}; - framing::ProtocolVersion version; - uint16_t id; + enum STATES {OPENING, OPEN, CLOSING, CLOSED}; + SessionCore& core; - uint16_t code; - std::string text; - void handleMethod(framing::AMQMethodBody* method); - void closed(uint16_t code, const std::string& msg); - -public: - typedef boost::function<void(uint16_t, const std::string&)> CloseListener; - - SessionHandler(); + void attach(const framing::AMQMethodBody&); + void detach(const framing::AMQMethodBody&); + + public: + SessionHandler(SessionCore& parent); + ~SessionHandler(); - void incoming(framing::AMQFrame& frame); - void outgoing(framing::AMQFrame& frame); + /** Incoming from broker */ + void handle(framing::AMQFrame&); - void open(uint16_t id); + void open(uint32_t detachedLifetime); + void resume(); void close(); - - CloseListener onClose; + void closed(); + void suspend(); }; }} |