summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Cluster.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index f6022aa5b8..b2650ffa7f 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -86,6 +86,7 @@ struct ClusterDispatcher : public framing::AMQP_AllOperations::ClusterHandler {
};
Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b) :
+ isQuorate(isQuorateImpl),
broker(b),
poller(b.getPoller()),
cpg(*this),
@@ -591,6 +592,17 @@ broker::Broker& Cluster::getBroker() const {
return broker; // Immutable, no need to lock.
}
+/** Default implementation for isQuorateImpl when there is no quorum service. */
+bool Cluster::isQuorateImpl() { return true; }
+
+void Cluster::checkQuorum() {
+ if (!isQuorate()) {
+ QPID_LOG(critical, *this << " disconnected from cluster quorum, shutting down");
+ leave();
+ throw Exception(QPID_MSG(*this << " disconnected from cluster quorum."));
+ }
+}
+
void Cluster::setClusterId(const Uuid& uuid) {
clusterId = uuid;
if (mgmtObject)