You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2007/09/17 22:22:57 UTC
svn commit: r576578 - in /incubator/qpid/trunk/qpid/cpp/src: ./ qpid/broker/
qpid/cluster/
Author: aconway
Date: Mon Sep 17 13:22:55 2007
New Revision: 576578
URL: http://svn.apache.org/viewvc?rev=576578&view=rev
Log:
Renamed SessionAdapter as SessionHandler.
Added:
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp
- copied, changed from r576566, incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.h
- copied, changed from r576566, incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.h
Removed:
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.h
Modified:
incubator/qpid/trunk/qpid/cpp/src/Makefile.am
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerAdapter.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticHandler.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.h
incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/SessionManager.cpp
Modified: incubator/qpid/trunk/qpid/cpp/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/Makefile.am?rev=576578&r1=576577&r2=576578&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/src/Makefile.am Mon Sep 17 13:22:55 2007
@@ -195,8 +195,8 @@
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 \
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerAdapter.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerAdapter.cpp?rev=576578&r1=576577&r2=576578&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerAdapter.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/BrokerAdapter.cpp Mon Sep 17 13:22:55 2007
@@ -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"
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp?rev=576578&r1=576577&r2=576578&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp Mon Sep 17 13:22:55 2007
@@ -52,7 +52,7 @@
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 @@
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);
}
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h?rev=576578&r1=576577&r2=576578&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h Mon Sep 17 13:22:55 2007
@@ -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 @@
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 @@
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;
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticHandler.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticHandler.cpp?rev=576578&r1=576577&r2=576578&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticHandler.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticHandler.cpp Mon Sep 17 13:22:55 2007
@@ -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::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.
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.cpp?rev=576578&r1=576577&r2=576578&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.cpp Mon Sep 17 13:22:55 2007
@@ -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::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),
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.h?rev=576578&r1=576577&r2=576578&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.h Mon Sep 17 13:22:55 2007
@@ -50,7 +50,7 @@
namespace broker {
-class SessionAdapter;
+class SessionHandler;
class Broker;
/**
@@ -99,7 +99,7 @@
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 @@
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; }
Copied: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp (from r576566, incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp)
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp?p2=incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp&p1=incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp&r1=576566&r2=576578&rev=576578&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp Mon Sep 17 13:22:55 2007
@@ -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 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::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 @@
<< 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 @@
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
Copied: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.h (from r576566, incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.h)
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.h?p2=incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.h&p1=incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.h&r1=576566&r2=576578&rev=576578&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.h Mon Sep 17 13:22:55 2007
@@ -38,20 +38,20 @@
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()
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/SessionManager.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/SessionManager.cpp?rev=576578&r1=576577&r2=576578&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/SessionManager.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/SessionManager.cpp Mon Sep 17 13:22:55 2007
@@ -40,7 +40,7 @@
struct SessionManager::BrokerHandler : public FrameHandler, private ChannelAdapter
{
Connection connection;
- SessionAdapter sessionAdapter;
+ SessionHandler sessionAdapter;
broker::Session session;
BrokerAdapter adapter;