diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2009-06-11 14:24:05 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2009-06-11 14:24:05 +0000 |
| commit | c379fbaadb80667779985d0b3108f8297e5b5c0d (patch) | |
| tree | ab1d48b71b623f4f71b04393f695f9dc648906ba /qpid/cpp | |
| parent | ae1ef611048e4b424a002bd67dd1ee1bd8923cf6 (diff) | |
| download | qpid-python-c379fbaadb80667779985d0b3108f8297e5b5c0d.tar.gz | |
Add flag to broker Connection so that it knows if it is a
local or shadow connection
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@783789 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Connection.cpp | 3 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Connection.h | 6 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/cluster/Connection.cpp | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/broker/Connection.cpp b/qpid/cpp/src/qpid/broker/Connection.cpp index c21fd49171..8575381453 100644 --- a/qpid/cpp/src/qpid/broker/Connection.cpp +++ b/qpid/cpp/src/qpid/broker/Connection.cpp @@ -58,7 +58,8 @@ Connection::Connection(ConnectionOutputHandler* out_, Broker& broker_, const std links(broker_.getLinks()), agent(0), timer(broker_.getTimer()), - errorListener(0) + errorListener(0), + shadow(false) { Manageable* parent = broker.GetVhostObject(); diff --git a/qpid/cpp/src/qpid/broker/Connection.h b/qpid/cpp/src/qpid/broker/Connection.h index df2c36c92e..8040d74a75 100644 --- a/qpid/cpp/src/qpid/broker/Connection.h +++ b/qpid/cpp/src/qpid/broker/Connection.h @@ -129,6 +129,11 @@ class Connection : public sys::ConnectionInputHandler, void sendClose(); void setSecureConnection(SecureConnection* secured); + /** True if this is a shadow connection in a cluster. */ + bool isShadow() { return shadow; } + /** Called by cluster to mark shadow connections */ + void setShadow() { shadow = true; } + private: typedef boost::ptr_map<framing::ChannelId, SessionHandler> ChannelMap; typedef std::vector<Queue::shared_ptr>::iterator queue_iterator; @@ -147,6 +152,7 @@ class Connection : public sys::ConnectionInputHandler, boost::intrusive_ptr<TimerTask> heartbeatTimer; boost::intrusive_ptr<TimerTask> timeoutTimer; ErrorListener* errorListener; + bool shadow; public: qmf::org::apache::qpid::broker::Connection* getMgmtObject() { return mgmtObject; } diff --git a/qpid/cpp/src/qpid/cluster/Connection.cpp b/qpid/cpp/src/qpid/cluster/Connection.cpp index be6281b4e3..afecbd50e5 100644 --- a/qpid/cpp/src/qpid/cluster/Connection.cpp +++ b/qpid/cpp/src/qpid/cluster/Connection.cpp @@ -94,6 +94,7 @@ void Connection::init() { else { // Shadow or catch-up connection connection.setClusterOrderOutput(nullFrameHandler); // Passive, discard cluster-order frames connection.setClientThrottling(false); // Disable client throttling, done by active node. + connection.setShadow(); // Mark the broker connection as a shadow. } if (!isCatchUp()) connection.setErrorListener(this); |
