summaryrefslogtreecommitdiff
path: root/cpp/src/qpid
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid')
-rw-r--r--cpp/src/qpid/Plugin.cpp17
-rw-r--r--cpp/src/qpid/Plugin.h3
-rw-r--r--cpp/src/qpid/cluster/Cpg.cpp2
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() {