summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Cluster.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.h')
-rw-r--r--cpp/src/qpid/cluster/Cluster.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.h b/cpp/src/qpid/cluster/Cluster.h
index 3a254684ad..5187cb08e7 100644
--- a/cpp/src/qpid/cluster/Cluster.h
+++ b/cpp/src/qpid/cluster/Cluster.h
@@ -75,11 +75,14 @@ class Cluster : private Cpg::Handler
/** Leave the cluster */
void leave();
- void joining(const MemberId&, const std::string& url);
+ void urlNotice(const MemberId&, const std::string& url);
void ready(const MemberId&);
MemberId getSelf() const { return self; }
+ void stall();
+ void unStall();
+
void shutdown();
broker::Broker& getBroker();
@@ -88,15 +91,13 @@ class Cluster : private Cpg::Handler
typedef std::map<MemberId, Url> UrlMap;
typedef std::map<ConnectionId, boost::intrusive_ptr<cluster::Connection> > ConnectionMap;
typedef sys::PollableQueue<Event> EventQueue;
+ enum State {
+ DISCARD, // Initially discard connection events up to my own join message.
+ READY, // Normal processing.
+ STALL // Stalled while a new member joins.
+ };
- boost::function<void()> shutdownNext;
-
- /** Handle a delivered frame */
- void deliverFrame(framing::AMQFrame&, const ConnectionId&);
-
- void deliverBuffer(const char*, size_t, const ConnectionId&);
-
- void deliverEvent(const Event&);
+ void connectionEvent(const Event&);
/** CPG deliver callback. */
void deliver(
@@ -136,7 +137,8 @@ class Cluster : private Cpg::Handler
ConnectionMap connections;
NoOpConnectionOutputHandler shadowOut;
sys::DispatchHandle cpgDispatchHandle;
- EventQueue deliverQueue;
+ EventQueue connectionEventQueue;
+ State state;
friend std::ostream& operator <<(std::ostream&, const Cluster&);
friend std::ostream& operator <<(std::ostream&, const UrlMap::value_type&);