diff options
| author | Alan Conway <aconway@apache.org> | 2010-01-27 22:21:28 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2010-01-27 22:21:28 +0000 |
| commit | 62315ddbbfcd5d41fd674bd2eb62f93d333d9ad4 (patch) | |
| tree | 1dbb2bd598e496db5779fe420e0dab6d456aa71c /cpp/src/qpid/broker/Broker.cpp | |
| parent | 863b9e190616873c561a3f468f01e0fc793cd466 (diff) | |
| download | qpid-python-62315ddbbfcd5d41fd674bd2eb62f93d333d9ad4.tar.gz | |
QPID_2634 Management updates in timer create inconsistencies in a cluster.
Cluster plugin provides a PeriodicTimer implementation to the broker
which executes tasks in the cluster dispatch thread simultaneously
across the cluster.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@903869 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Broker.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/Broker.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/Broker.cpp b/cpp/src/qpid/broker/Broker.cpp index f47b6418bd..cd3b014256 100644 --- a/cpp/src/qpid/broker/Broker.cpp +++ b/cpp/src/qpid/broker/Broker.cpp @@ -137,7 +137,6 @@ const std::string knownHostsNone("none"); Broker::Broker(const Broker::Options& conf) : poller(new Poller), - periodicTimer(new sys::PeriodicTimerImpl(timer)), config(conf), managementAgent(conf.enableMgmt ? new ManagementAgent() : 0), store(new NullMessageStore), @@ -258,6 +257,12 @@ Broker::Broker(const Broker::Options& conf) : // Initialize plugins Plugin::initializeAll(*this); + if (!periodicTimer.hasDelegate()) { + // If no plugin has contributed a PeriodicTimer, use the default one. + periodicTimer.setDelegate( + std::auto_ptr<sys::PeriodicTimer>(new sys::PeriodicTimerImpl(timer))); + } + if (conf.queueCleanInterval) { queueCleaner.start(conf.queueCleanInterval * qpid::sys::TIME_SEC); } @@ -469,6 +474,10 @@ Broker::getKnownBrokersImpl() return knownBrokers; } +void Broker::setPeriodicTimer(std::auto_ptr<sys::PeriodicTimer> pt) { + periodicTimer.setDelegate(pt); +} + const std::string Broker::TCP_TRANSPORT("tcp"); }} // namespace qpid::broker |
