diff options
author | Alan Conway <aconway@apache.org> | 2008-11-06 22:40:57 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-11-06 22:40:57 +0000 |
commit | 17716fee99670e49a1c3526a44c40d15757d94e3 (patch) | |
tree | a61a44820b9ee72d920a65f3d5683585b652fa76 /cpp/src/qpid/broker/Broker.cpp | |
parent | 2de0473cf8c64e06396c5f5e6a0cf8b5e982514e (diff) | |
download | qpid-python-17716fee99670e49a1c3526a44c40d15757d94e3.tar.gz |
Add Message callbacks for async completion.
Add unit test for async completion.
Add sync parameter to generated session functions, defaults as before but allows greater control.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@711998 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Broker.cpp')
-rw-r--r-- | cpp/src/qpid/broker/Broker.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/cpp/src/qpid/broker/Broker.cpp b/cpp/src/qpid/broker/Broker.cpp index be13538ca6..3ba2e70bc2 100644 --- a/cpp/src/qpid/broker/Broker.cpp +++ b/cpp/src/qpid/broker/Broker.cpp @@ -194,16 +194,12 @@ Broker::Broker(const Broker::Options& conf) : (*i)->earlyInitialize(*this); // If no plugin store module registered itself, set up the null store. - if (store == 0) + if (store.get() == 0) setStore (new NullMessageStore (false)); - queues.setStore (store); - dtxManager.setStore (store); - links.setStore (store); - exchanges.declare(empty, DirectExchange::typeName); // Default exchange. - if (store != 0) { + if (store.get() != 0) { RecoveryManagerImpl recoverer(queues, exchanges, links, dtxManager, conf.stagingThreshold); store->recover(recoverer); @@ -247,7 +243,7 @@ Broker::Broker(const Broker::Options& conf) : void Broker::declareStandardExchange(const std::string& name, const std::string& type) { - bool storeEnabled = store != NULL; + bool storeEnabled = store.get() != NULL; std::pair<Exchange::shared_ptr, bool> status = exchanges.declare(name, type, storeEnabled); if (status.second && storeEnabled) { store->create(*status.first, framing::FieldTable ()); @@ -269,9 +265,10 @@ boost::intrusive_ptr<Broker> Broker::create(const Options& opts) void Broker::setStore (MessageStore* _store) { - assert (store == 0 && _store != 0); - if (store == 0 && _store != 0) - store = new MessageStoreModule (_store); + store.reset(new MessageStoreModule (_store)); + queues.setStore (store.get()); + dtxManager.setStore (store.get()); + links.setStore (store.get()); } void Broker::run() { @@ -304,7 +301,6 @@ void Broker::shutdown() { Broker::~Broker() { shutdown(); finalize(); // Finalize any plugins. - delete store; if (config.auth) SaslAuthenticator::fini(); QPID_LOG(notice, "Shut down"); |