diff options
author | Alan Conway <aconway@apache.org> | 2008-11-19 13:52:51 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-11-19 13:52:51 +0000 |
commit | 18dee70d90657834e1afc2af1e541597ea18abf6 (patch) | |
tree | 6b4c7e6bde8f25171e88b7712ab7c7995a8556f9 /cpp/src/qpid/cluster/Cluster.cpp | |
parent | 0c633b78d0c5784e4261b3ab0cefd3e016d9940d (diff) | |
download | qpid-python-18dee70d90657834e1afc2af1e541597ea18abf6.tar.gz |
Fix --cluster-cman option to enable cman integration.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@718961 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/Cluster.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp index b2650ffa7f..5dffae2b2f 100644 --- a/cpp/src/qpid/cluster/Cluster.cpp +++ b/cpp/src/qpid/cluster/Cluster.cpp @@ -85,8 +85,7 @@ struct ClusterDispatcher : public framing::AMQP_AllOperations::ClusterHandler { bool invoke(AMQBody& body) { return framing::invoke(*this, body).wasHandled(); } }; -Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b) : - isQuorate(isQuorateImpl), +Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b, bool useQuorum) : broker(b), poller(b.getPoller()), cpg(*this), @@ -117,8 +116,9 @@ Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b) : broker.addFinalizer(boost::bind(&Cluster::brokerShutdown, this)); cpgDispatchHandle.startWatch(poller); deliverQueue.start(); + QPID_LOG(notice, *this << " joining cluster " << name.str()); + if (useQuorum) quorum.init(); cpg.join(name); - QPID_LOG(notice, *this << " will join cluster " << name.str()); } Cluster::~Cluster() { @@ -592,11 +592,8 @@ 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()) { + if (!quorum.isQuorate()) { QPID_LOG(critical, *this << " disconnected from cluster quorum, shutting down"); leave(); throw Exception(QPID_MSG(*this << " disconnected from cluster quorum.")); |