diff options
author | Alan Conway <aconway@apache.org> | 2007-09-17 20:22:55 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-09-17 20:22:55 +0000 |
commit | 24966bd7fbaff11d8a0f1ad282180154c96a7d2f (patch) | |
tree | 3858d26f5e8d910b4b9806b2cbc1741f713d5a51 | |
parent | 356c93ebddb342f70cf64361cfc3024af7878c82 (diff) | |
download | qpid-python-24966bd7fbaff11d8a0f1ad282180154c96a7d2f.tar.gz |
Renamed SessionAdapter as SessionHandler.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@576578 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/src/Makefile.am | 4 | ||||
-rw-r--r-- | cpp/src/qpid/broker/BrokerAdapter.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/broker/Connection.cpp | 6 | ||||
-rw-r--r-- | cpp/src/qpid/broker/Connection.h | 8 | ||||
-rw-r--r-- | cpp/src/qpid/broker/SemanticHandler.cpp | 4 | ||||
-rw-r--r-- | cpp/src/qpid/broker/Session.cpp | 4 | ||||
-rw-r--r-- | cpp/src/qpid/broker/Session.h | 10 | ||||
-rw-r--r-- | cpp/src/qpid/broker/SessionHandler.cpp (renamed from cpp/src/qpid/broker/SessionAdapter.cpp) | 30 | ||||
-rw-r--r-- | cpp/src/qpid/broker/SessionHandler.h (renamed from cpp/src/qpid/broker/SessionAdapter.h) | 10 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/SessionManager.cpp | 2 |
10 files changed, 40 insertions, 40 deletions
diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am index d3aad9939e..49535babff 100644 --- a/cpp/src/Makefile.am +++ b/cpp/src/Makefile.am @@ -195,8 +195,8 @@ libqpidbroker_la_SOURCES = \ qpid/broker/RecoveredDequeue.cpp \ qpid/broker/Session.h \ qpid/broker/Session.cpp \ - qpid/broker/SessionAdapter.h \ - qpid/broker/SessionAdapter.cpp \ + qpid/broker/SessionHandler.h \ + qpid/broker/SessionHandler.cpp \ qpid/broker/SemanticHandler.cpp \ qpid/broker/Timer.cpp \ qpid/broker/TopicExchange.cpp \ diff --git a/cpp/src/qpid/broker/BrokerAdapter.cpp b/cpp/src/qpid/broker/BrokerAdapter.cpp index b3a8e135a3..35a87784d2 100644 --- a/cpp/src/qpid/broker/BrokerAdapter.cpp +++ b/cpp/src/qpid/broker/BrokerAdapter.cpp @@ -17,7 +17,7 @@ */ #include "BrokerAdapter.h" #include "Session.h" -#include "SessionAdapter.h" +#include "SessionHandler.h" #include "Connection.h" #include "DeliveryToken.h" #include "MessageDelivery.h" diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index 825ce4978c..ec6fd6ece7 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -52,7 +52,7 @@ void Connection::received(framing::AMQFrame& frame){ if (frame.getChannel() == 0) { adapter.handle(frame); } else { - SessionAdapter sa = getChannel(frame.getChannel()); + SessionHandler sa = getChannel(frame.getChannel()); sa.in(frame); } } @@ -94,8 +94,8 @@ void Connection::closeChannel(uint16_t id) { if (i != channels.end()) channels.erase(i); } -SessionAdapter Connection::getChannel(ChannelId id) { - boost::optional<SessionAdapter>& ch = channels[id]; +SessionHandler Connection::getChannel(ChannelId id) { + boost::optional<SessionHandler>& ch = channels[id]; if (!ch) { ch = boost::in_place(boost::ref(*this), id); } diff --git a/cpp/src/qpid/broker/Connection.h b/cpp/src/qpid/broker/Connection.h index ff7fb4e327..3dd6bfbb29 100644 --- a/cpp/src/qpid/broker/Connection.h +++ b/cpp/src/qpid/broker/Connection.h @@ -38,7 +38,7 @@ #include "qpid/Exception.h" #include "Session.h" #include "ConnectionAdapter.h" -#include "SessionAdapter.h" +#include "SessionHandler.h" #include <boost/optional.hpp> @@ -51,8 +51,8 @@ class Connection : public sys::ConnectionInputHandler, public: Connection(sys::ConnectionOutputHandler* out, Broker& broker); - /** Get the SessionAdapter for channel. Create if it does not already exist */ - SessionAdapter getChannel(framing::ChannelId channel); + /** Get the SessionHandler for channel. Create if it does not already exist */ + SessionHandler getChannel(framing::ChannelId channel); /** Close the connection */ void close(framing::ReplyCode code, const string& text, framing::ClassId classId, framing::MethodId methodId); @@ -85,7 +85,7 @@ class Connection : public sys::ConnectionInputHandler, private: // Use boost::optional to allow default-constructed uninitialized entries in the map. - typedef std::map<framing::ChannelId, boost::optional<SessionAdapter> >ChannelMap; + typedef std::map<framing::ChannelId, boost::optional<SessionHandler> >ChannelMap; typedef std::vector<Queue::shared_ptr>::iterator queue_iterator; framing::ProtocolVersion version; diff --git a/cpp/src/qpid/broker/SemanticHandler.cpp b/cpp/src/qpid/broker/SemanticHandler.cpp index dab41dd92f..60c6a5cc10 100644 --- a/cpp/src/qpid/broker/SemanticHandler.cpp +++ b/cpp/src/qpid/broker/SemanticHandler.cpp @@ -21,7 +21,7 @@ #include "SemanticHandler.h" #include "Session.h" -#include "SessionAdapter.h" +#include "SessionHandler.h" #include "BrokerAdapter.h" #include "MessageDelivery.h" #include "Connection.h" @@ -187,7 +187,7 @@ void SemanticHandler::redeliver(Message::shared_ptr& msg, DeliveryToken::shared_ void SemanticHandler::send(const AMQBody& body) { Mutex::ScopedLock l(outLock); - // FIXME aconway 2007-08-31: SessionAdapter should not send + // FIXME aconway 2007-08-31: SessionHandler should not send // channel/session commands via the semantic handler, it should shortcut // directly to its own output handler. That will make the CLASS_ID // part of the test unnecessary. diff --git a/cpp/src/qpid/broker/Session.cpp b/cpp/src/qpid/broker/Session.cpp index 8e8632e922..6bc96b0049 100644 --- a/cpp/src/qpid/broker/Session.cpp +++ b/cpp/src/qpid/broker/Session.cpp @@ -29,7 +29,7 @@ #include "DtxTimeout.h" #include "Message.h" #include "SemanticHandler.h" -#include "SessionAdapter.h" +#include "SessionHandler.h" #include "TxAck.h" #include "TxPublish.h" #include "qpid/QpidError.h" @@ -56,7 +56,7 @@ using namespace qpid::broker; using namespace qpid::framing; using namespace qpid::sys; -Session::Session(SessionAdapter& a, uint32_t t) +Session::Session(SessionHandler& a, uint32_t t) : adapter(&a), broker(adapter->getConnection().broker), timeout(t), diff --git a/cpp/src/qpid/broker/Session.h b/cpp/src/qpid/broker/Session.h index 6b9d3e9557..afcd5853fa 100644 --- a/cpp/src/qpid/broker/Session.h +++ b/cpp/src/qpid/broker/Session.h @@ -50,7 +50,7 @@ class AMQP_ClientProxy; namespace broker { -class SessionAdapter; +class SessionHandler; class Broker; /** @@ -99,7 +99,7 @@ class Session : public framing::FrameHandler::Chains, typedef boost::ptr_map<string,ConsumerImpl> ConsumerImplMap; - SessionAdapter* adapter; + SessionHandler* adapter; Broker& broker; uint32_t timeout; boost::ptr_vector<framing::FrameHandler> handlers; @@ -137,12 +137,12 @@ class Session : public framing::FrameHandler::Chains, public: - Session(SessionAdapter&, uint32_t timeout); + Session(SessionHandler&, uint32_t timeout); ~Session(); /** Returns 0 if this session is not currently attached */ - SessionAdapter* getAdapter() { return adapter; } - const SessionAdapter* getAdapter() const { return adapter; } + SessionHandler* getAdapter() { return adapter; } + const SessionHandler* getAdapter() const { return adapter; } Broker& getBroker() const { return broker; } diff --git a/cpp/src/qpid/broker/SessionAdapter.cpp b/cpp/src/qpid/broker/SessionHandler.cpp index f9d352aa6a..c6ba73e43a 100644 --- a/cpp/src/qpid/broker/SessionAdapter.cpp +++ b/cpp/src/qpid/broker/SessionHandler.cpp @@ -18,7 +18,7 @@ * */ -#include "SessionAdapter.h" +#include "SessionHandler.h" #include "Session.h" #include "Connection.h" #include "qpid/framing/reply_exceptions.h" @@ -29,31 +29,31 @@ namespace qpid { namespace broker { using namespace framing; -// FIXME aconway 2007-08-31: the SessionAdapter should create its +// FIXME aconway 2007-08-31: the SessionHandler should create its // private proxy directly on the connections out handler. // Session/channel methods should not go thru the other layers. // Need to get rid of ChannelAdapter and allow proxies to be created // directly on output handlers. // -framing::AMQP_ClientProxy& SessionAdapter::getProxy() { +framing::AMQP_ClientProxy& SessionHandler::getProxy() { return session->getProxy(); } -SessionAdapter::SessionAdapter(Connection& c, ChannelId ch) +SessionHandler::SessionHandler(Connection& c, ChannelId ch) : connection(c), channel(ch), ignoring(false) { in = this; out = &c.getOutput(); } -SessionAdapter::~SessionAdapter() {} +SessionHandler::~SessionHandler() {} namespace { ClassId classId(AMQMethodBody* m) { return m ? m->amqpMethodId() : 0; } MethodId methodId(AMQMethodBody* m) { return m ? m->amqpClassId() : 0; } } // namespace -void SessionAdapter::handle(AMQFrame& f) { +void SessionHandler::handle(AMQFrame& f) { // Note on channel states: a channel is open if session != 0. A // channel that is closed (session == 0) can be in the "ignoring" // state. This is a temporary state after we have sent a channel @@ -82,14 +82,14 @@ void SessionAdapter::handle(AMQFrame& f) { } } -void SessionAdapter::assertOpen(const char* method) { +void SessionHandler::assertOpen(const char* method) { if (!session) throw ChannelErrorException( QPID_MSG(""<<method<<" failed: No session for channel " << getChannel())); } -void SessionAdapter::assertClosed(const char* method) { +void SessionHandler::assertClosed(const char* method) { // FIXME aconway 2007-08-31: Should raise channel-busy, need // to update spec. if (session) @@ -99,21 +99,21 @@ void SessionAdapter::assertClosed(const char* method) { << getChannel())); } -void SessionAdapter::open(const string& /*outOfBand*/){ +void SessionHandler::open(const string& /*outOfBand*/){ assertClosed("open"); session.reset(new Session(*this, 0)); getProxy().getChannel().openOk(); } // FIXME aconway 2007-08-31: flow is no longer in the spec. -void SessionAdapter::flow(bool active){ +void SessionHandler::flow(bool active){ session->flow(active); getProxy().getChannel().flowOk(active); } -void SessionAdapter::flowOk(bool /*active*/){} +void SessionHandler::flowOk(bool /*active*/){} -void SessionAdapter::close(uint16_t replyCode, +void SessionHandler::close(uint16_t replyCode, const string& replyText, uint16_t classId, uint16_t methodId) { @@ -126,18 +126,18 @@ void SessionAdapter::close(uint16_t replyCode, ignoring=false; getProxy().getChannel().closeOk(); // FIXME aconway 2007-08-31: sould reset session BEFORE - // sending closeOK to avoid races. SessionAdapter + // sending closeOK to avoid races. SessionHandler // needs its own private proxy, see getProxy() above. session.reset(); // No need to remove from connection map, will be re-used // if channel is re-opened. } -void SessionAdapter::closeOk(){ +void SessionHandler::closeOk(){ ignoring=false; } -void SessionAdapter::ok() +void SessionHandler::ok() { //no specific action required, generic response handling should be //sufficient diff --git a/cpp/src/qpid/broker/SessionAdapter.h b/cpp/src/qpid/broker/SessionHandler.h index 6dd409cc80..62e4c8daf2 100644 --- a/cpp/src/qpid/broker/SessionAdapter.h +++ b/cpp/src/qpid/broker/SessionHandler.h @@ -38,20 +38,20 @@ class Connection; class Session; /** - * A SessionAdapter is associated with each active channel. It + * A SessionHandler is associated with each active channel. It * receives incoming frames, handles session commands and manages the * association between the channel and a session. * - * SessionAdapters can be stored in a map by value. + * SessionHandlers can be stored in a map by value. */ -class SessionAdapter : +class SessionHandler : public framing::FrameHandler::Chains, private framing::FrameHandler, private framing::AMQP_ServerOperations::ChannelHandler { public: - SessionAdapter(Connection&, framing::ChannelId); - ~SessionAdapter(); + SessionHandler(Connection&, framing::ChannelId); + ~SessionHandler(); /** Handle AMQP session methods, pass other frames to the session * if there is one. Frames channel must be == getChannel() diff --git a/cpp/src/qpid/cluster/SessionManager.cpp b/cpp/src/qpid/cluster/SessionManager.cpp index dc14b24905..537b17a23c 100644 --- a/cpp/src/qpid/cluster/SessionManager.cpp +++ b/cpp/src/qpid/cluster/SessionManager.cpp @@ -40,7 +40,7 @@ using namespace broker; struct SessionManager::BrokerHandler : public FrameHandler, private ChannelAdapter { Connection connection; - SessionAdapter sessionAdapter; + SessionHandler sessionAdapter; broker::Session session; BrokerAdapter adapter; |