diff options
| author | Alan Conway <aconway@apache.org> | 2008-06-26 18:12:12 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-06-26 18:12:12 +0000 |
| commit | eabcd5c760c8d3b3e8f6f45a29c19148560f91cd (patch) | |
| tree | a3f7e152d7ef07d8507136bb35f8a814b1db65c5 /cpp/src/qpid | |
| parent | a705fb49d4571b3b22ffd597c07e42a1b43e9322 (diff) | |
| download | qpid-python-eabcd5c760c8d3b3e8f6f45a29c19148560f91cd.tar.gz | |
Consolidated cluster tests in cluster_test.cpp
Improvements to BrokerFixture for testing.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@671969 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
| -rw-r--r-- | cpp/src/qpid/Plugin.cpp | 17 | ||||
| -rw-r--r-- | cpp/src/qpid/Plugin.h | 3 | ||||
| -rw-r--r-- | cpp/src/qpid/cluster/Cpg.cpp | 2 |
3 files changed, 15 insertions, 7 deletions
diff --git a/cpp/src/qpid/Plugin.cpp b/cpp/src/qpid/Plugin.cpp index 77627c3742..733d134334 100644 --- a/cpp/src/qpid/Plugin.cpp +++ b/cpp/src/qpid/Plugin.cpp @@ -19,16 +19,16 @@ */ #include "Plugin.h" +#include "qpid/Options.h" namespace qpid { namespace { -// This is a single threaded singleton implementation so -// it is important to be sure that the first use of this -// singleton is when the program is still single threaded Plugin::Plugins& thePlugins() { + // This is a single threaded singleton implementation so + // it is important to be sure that the first use of this + // singleton is when the program is still single threaded static Plugin::Plugins plugins; - return plugins; } } @@ -42,8 +42,13 @@ Plugin::~Plugin() {} Options* Plugin::getOptions() { return 0; } -const Plugin::Plugins& Plugin::getPlugins() { - return thePlugins(); +const Plugin::Plugins& Plugin::getPlugins() { return thePlugins(); } + +void Plugin::addOptions(Options& opts) { + for (Plugins::const_iterator i = getPlugins().begin(); i != getPlugins().end(); ++i) { + if ((*i)->getOptions()) + opts.add(*(*i)->getOptions()); + } } } // namespace qpid diff --git a/cpp/src/qpid/Plugin.h b/cpp/src/qpid/Plugin.h index 7b01c83273..3ead770129 100644 --- a/cpp/src/qpid/Plugin.h +++ b/cpp/src/qpid/Plugin.h @@ -88,6 +88,9 @@ class Plugin : boost::noncopyable * Caller must not delete plugin pointers. */ static const Plugins& getPlugins(); + + /** For each registered plugin, add plugin.getOptions() to opts. */ + static void addOptions(Options& opts); }; } // namespace qpid diff --git a/cpp/src/qpid/cluster/Cpg.cpp b/cpp/src/qpid/cluster/Cpg.cpp index 01d97d2a17..ce8aa0dc33 100644 --- a/cpp/src/qpid/cluster/Cpg.cpp +++ b/cpp/src/qpid/cluster/Cpg.cpp @@ -92,7 +92,7 @@ Cpg::Cpg(Handler& h) : handler(h) { cpg_callbacks_t callbacks = { &globalDeliver, &globalConfigChange }; check(cpg_initialize(&handle, &callbacks), "Cannot initialize CPG"); handles.put(handle, &handler); - QPID_LOG(debug, "Initialize CPG handle " << handle); + QPID_LOG(debug, "Initialize CPG handle 0x" << std::hex << handle); } Cpg::~Cpg() { |
