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/ClusterPlugin.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/ClusterPlugin.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/ClusterPlugin.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cpp/src/qpid/cluster/ClusterPlugin.cpp b/cpp/src/qpid/cluster/ClusterPlugin.cpp index fad0563872..eaf2631d03 100644 --- a/cpp/src/qpid/cluster/ClusterPlugin.cpp +++ b/cpp/src/qpid/cluster/ClusterPlugin.cpp @@ -39,7 +39,10 @@ using broker::Broker; struct ClusterValues { string name; string url; + bool quorum; + ClusterValues() : quorum(false) {} + Url getUrl(uint16_t port) const { if (url.empty()) return Url::getIpAddressesUrl(port); return Url(url); @@ -59,6 +62,9 @@ struct ClusterOptions : public Options { ("cluster-url", optValue(values.url,"URL"), "URL of this broker, advertized to the cluster.\n" "Defaults to a URL listing all the local IP addresses\n") +#if HAVE_LIBCMAN + ("cluster-cman", optValue(values.quorum), "Integrate with Cluster Manager (CMAN) cluster.") +#endif ; } }; @@ -78,7 +84,7 @@ struct ClusterPlugin : public Plugin { if (values.name.empty()) return; // Only if --cluster-name option was specified. Broker* broker = dynamic_cast<Broker*>(&target); if (!broker) return; - cluster = new Cluster(values.name, values.getUrl(broker->getPort(Broker::TCP_TRANSPORT)), *broker); + cluster = new Cluster(values.name, values.getUrl(broker->getPort(Broker::TCP_TRANSPORT)), *broker, values.quorum); broker->setConnectionFactory( boost::shared_ptr<sys::ConnectionCodec::Factory>( new ConnectionCodec::Factory(broker->getConnectionFactory(), *cluster))); |