diff options
| author | Alan Conway <aconway@apache.org> | 2008-01-14 14:55:08 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-01-14 14:55:08 +0000 |
| commit | 213cb56843cf55b06209834a914a1ac958445cb5 (patch) | |
| tree | 71a6ad997ab53a5159c56b50e24209b9d8e91761 /cpp/src | |
| parent | b425b50dbcf2062b10cee8e6dd48e4f6d3240a03 (diff) | |
| download | qpid-python-213cb56843cf55b06209834a914a1ac958445cb5.tar.gz | |
Apply patch from QPID-732 by Ted Ross.
The attached patch provides support for plugin modules in the C++ broker.
- Plugins are supported (--load <lib>, --load-dir <dir> options provided)
- Command options may be extended by plugins.
- A workaround was added to make config-file parsing tolerant of unregistered options.
- Store-specific options were removed so they can be supplied by a plugin
- A pre-log facility was introduced so log messages can be generated prior to the initialization of the logging module.
File-by-file details:
M cpp/src/qpidd.cpp
Added support for loadable plugin modules. This involves a
two-phased handling of command line/config options. Phase-1
determines which modules to load and phase-2 is based on all of
the command-line options supplied by qpidd and the loaded
plugins.
M cpp/src/Makefile.am
Added dependency for boost_filesystem library.
M cpp/src/qpid/Plugin.h
Added 'earlyInitialize' method. Plugins are now initialized at
two points: earlyInitialize is called prior to broker
initialization and initialize is called at the end of broker
init. This allows modules like the store to be hooked in early
and other modules to be able to assume that the broker target is
fully functional.
M cpp/src/qpid/cluster/ClusterPlugin.cpp
Added stub for the new pure-virtual earlyInitialize method.
M cpp/src/qpid/Options.h
M cpp/src/qpid/Options.cpp
Added 'allowUnknown' option in the parse method. This is needed
in phase-1 command processing when there are options for
not-yet-loaded plugin modules.
Because the stable version of boost does not permit 'allowUnknown'
for config files, a workaround has been implemented in this module
to pre-filter the config file text removing lines that represent
unknown options.
M cpp/src/qpid/broker/Broker.h
M cpp/src/qpid/broker/Broker.cpp
Removed all store-specific command options. Updated logic to
allow the store to be a plugin module.
M cpp/src/qpid/broker/DtxManager.h
M cpp/src/qpid/broker/DtxManager.cpp
M cpp/src/qpid/broker/QueueRegistry.h
M cpp/src/qpid/broker/QueueRegistry.cpp
Changed API to these classes such that the store is no longer
supplied in the constructor but is supplied later, before any
operations are called for.
M cpp/src/qpid/broker/MessageStoreModule.h
M cpp/src/qpid/broker/MessageStoreModule.cpp
This module is still needed to provide "exception transfer"
service. It was changed to not load the store module but rather
use the already-loaded plugin store.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@611822 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
| -rw-r--r-- | cpp/src/qpid/broker/Broker.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/cpp/src/qpid/broker/Broker.h b/cpp/src/qpid/broker/Broker.h index aaa0be72bb..32a3ea55f7 100644 --- a/cpp/src/qpid/broker/Broker.h +++ b/cpp/src/qpid/broker/Broker.h @@ -59,6 +59,7 @@ namespace broker { class Broker : public sys::Runnable, public Plugin::Target, public management::Manageable { public: + struct Options : public qpid::Options { Options(const std::string& name="Broker Options"); @@ -66,13 +67,7 @@ class Broker : public sys::Runnable, public Plugin::Target, public management::M int workerThreads; int maxConnections; int connectionBacklog; - std::string store; - long stagingThreshold; - string storeDir; - bool storeAsync; - bool storeForce; - u_int16_t numJrnlFiles; - u_int32_t jrnlFsizePgs; + uint64_t stagingThreshold; bool enableMgmt; uint16_t mgmtPubInterval; uint32_t ack; @@ -109,7 +104,8 @@ class Broker : public sys::Runnable, public Plugin::Target, public management::M /** Apply all handler updaters to a handler chain pair. */ void update(framing::ChannelId, framing::FrameHandler::Chains&); - + + void setStore (MessageStore*); MessageStore& getStore() { return *store; } QueueRegistry& getQueues() { return queues; } ExchangeRegistry& getExchanges() { return exchanges; } @@ -128,7 +124,7 @@ class Broker : public sys::Runnable, public Plugin::Target, public management::M Options config; sys::Acceptor::shared_ptr acceptor; - const std::auto_ptr<MessageStore> store; + MessageStore* store; typedef std::vector<shared_ptr<framing::HandlerUpdater> > HandlerUpdaters; QueueRegistry queues; @@ -141,7 +137,6 @@ class Broker : public sys::Runnable, public Plugin::Target, public management::M management::Broker::shared_ptr mgmtObject; Vhost::shared_ptr vhostObject; - static MessageStore* createStore(const Options& config); void declareStandardExchange(const std::string& name, const std::string& type); }; |
