diff options
| author | Alan Conway <aconway@apache.org> | 2008-11-18 19:55:59 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-11-18 19:55:59 +0000 |
| commit | 970fba7f2422eab256273a610135be33bd37f7d6 (patch) | |
| tree | 2e1e66e3bd717c2adc02b9787bb55a0c20679381 /cpp/src/qpid/cluster/Cluster.cpp | |
| parent | b355d0e5b46739c74e9cbef449d8fc50646e4db2 (diff) | |
| download | qpid-python-970fba7f2422eab256273a610135be33bd37f7d6.tar.gz | |
Optional cluster integration with cman quorum service.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@718693 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
| -rw-r--r-- | cpp/src/qpid/cluster/Cluster.cpp | 12 |
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) |
