From b0a120b4edfdb49a08bd7c8c2479e7b1cadc5233 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 30 Oct 2006 19:27:54 +0000 Subject: Initial implementation for tx class. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@469242 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SessionHandlerImpl.h | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'cpp/src/qpid/broker/SessionHandlerImpl.h') diff --git a/cpp/src/qpid/broker/SessionHandlerImpl.h b/cpp/src/qpid/broker/SessionHandlerImpl.h index afaae74d97..6b9b5cca6b 100644 --- a/cpp/src/qpid/broker/SessionHandlerImpl.h +++ b/cpp/src/qpid/broker/SessionHandlerImpl.h @@ -71,11 +71,12 @@ class SessionHandlerImpl : public virtual qpid::io::SessionHandler, AutoDelete* const cleaner; const u_int32_t timeout;//timeout for auto-deleted queues (in ms) - std::auto_ptr connectionHandler; - std::auto_ptr channelHandler; std::auto_ptr basicHandler; + std::auto_ptr channelHandler; + std::auto_ptr connectionHandler; std::auto_ptr exchangeHandler; std::auto_ptr queueHandler; + std::auto_ptr txHandler; std::map channels; std::vector exclusiveQueues; @@ -212,18 +213,29 @@ class SessionHandlerImpl : public virtual qpid::io::SessionHandler, virtual ~BasicHandlerImpl(){} }; + class TxHandlerImpl : public virtual TxHandler{ + SessionHandlerImpl* parent; + public: + TxHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} + virtual ~TxHandlerImpl() {} + virtual void select(u_int16_t channel); + virtual void commit(u_int16_t channel); + virtual void rollback(u_int16_t channel); + }; + + inline virtual ChannelHandler* getChannelHandler(){ return channelHandler.get(); } inline virtual ConnectionHandler* getConnectionHandler(){ return connectionHandler.get(); } inline virtual BasicHandler* getBasicHandler(){ return basicHandler.get(); } inline virtual ExchangeHandler* getExchangeHandler(){ return exchangeHandler.get(); } inline virtual QueueHandler* getQueueHandler(){ return queueHandler.get(); } + inline virtual TxHandler* getTxHandler(){ return txHandler.get(); } - inline virtual AccessHandler* getAccessHandler(){ return 0; } - inline virtual FileHandler* getFileHandler(){ return 0; } - inline virtual StreamHandler* getStreamHandler(){ return 0; } - inline virtual TxHandler* getTxHandler(){ return 0; } - inline virtual DtxHandler* getDtxHandler(){ return 0; } - inline virtual TunnelHandler* getTunnelHandler(){ return 0; } + inline virtual AccessHandler* getAccessHandler(){ throw ConnectionException(540, "Access class not implemented"); } + inline virtual FileHandler* getFileHandler(){ throw ConnectionException(540, "File class not implemented"); } + inline virtual StreamHandler* getStreamHandler(){ throw ConnectionException(540, "Stream class not implemented"); } + inline virtual DtxHandler* getDtxHandler(){ throw ConnectionException(540, "Dtx class not implemented"); } + inline virtual TunnelHandler* getTunnelHandler(){ throw ConnectionException(540, "Tunnel class not implemented"); } }; } -- cgit v1.2.1