diff options
| author | Kim van der Riet <kpvdr@apache.org> | 2007-12-04 21:54:03 +0000 |
|---|---|---|
| committer | Kim van der Riet <kpvdr@apache.org> | 2007-12-04 21:54:03 +0000 |
| commit | a8e232a41365a573fd047ea702dd125130bd057a (patch) | |
| tree | 07c415cc185623d90112d7d42aabd3545d26a480 /cpp/src/qpid/broker/MessageStoreModule.cpp | |
| parent | e9aabf87ff40c4f9bcbbb37688eae1ba1c1e71e3 (diff) | |
| download | qpid-python-a8e232a41365a573fd047ea702dd125130bd057a.tar.gz | |
Added options to broker for journal file size. Also brought back exception copying in MessageStoreModue to prevent exceptions thrown in the store lib causing cores when handled in qpidd.cpp.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@601099 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/MessageStoreModule.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/MessageStoreModule.cpp | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/cpp/src/qpid/broker/MessageStoreModule.cpp b/cpp/src/qpid/broker/MessageStoreModule.cpp index d769030172..4850cfb921 100644 --- a/cpp/src/qpid/broker/MessageStoreModule.cpp +++ b/cpp/src/qpid/broker/MessageStoreModule.cpp @@ -22,121 +22,124 @@ #include "MessageStoreModule.h" #include <iostream> +// This transfer protects against the unloading of the store lib prior to the handling of the exception +#define TRANSFER_EXCEPTION(fn) try { fn; } catch (std::exception& e) { throw Exception(e.what()); } + using namespace qpid::broker; MessageStoreModule::MessageStoreModule(const std::string& name) : store(name) { } -bool MessageStoreModule::init(const std::string& dir, const bool async, const bool force) +bool MessageStoreModule::init(const Options* options) { - return store->init(dir, async, force); + TRANSFER_EXCEPTION(return store->init(options)); } void MessageStoreModule::create(PersistableQueue& queue) { - store->create(queue); + TRANSFER_EXCEPTION(store->create(queue)); } void MessageStoreModule::destroy(PersistableQueue& queue) { - store->destroy(queue); + TRANSFER_EXCEPTION(store->destroy(queue)); } void MessageStoreModule::create(const PersistableExchange& exchange) { - store->create(exchange); + TRANSFER_EXCEPTION(store->create(exchange)); } void MessageStoreModule::destroy(const PersistableExchange& exchange) { - store->destroy(exchange); + TRANSFER_EXCEPTION(store->destroy(exchange)); } void MessageStoreModule::bind(const PersistableExchange& e, const PersistableQueue& q, const std::string& k, const framing::FieldTable& a) { - store->bind(e, q, k, a); + TRANSFER_EXCEPTION(store->bind(e, q, k, a)); } void MessageStoreModule::unbind(const PersistableExchange& e, const PersistableQueue& q, const std::string& k, const framing::FieldTable& a) { - store->unbind(e, q, k, a); + TRANSFER_EXCEPTION(store->unbind(e, q, k, a)); } void MessageStoreModule::recover(RecoveryManager& registry) { - store->recover(registry); + TRANSFER_EXCEPTION(store->recover(registry)); } void MessageStoreModule::stage( intrusive_ptr<PersistableMessage>& msg) { - store->stage(msg); + TRANSFER_EXCEPTION(store->stage(msg)); } void MessageStoreModule::destroy(intrusive_ptr<PersistableMessage>& msg) { - store->destroy(msg); + TRANSFER_EXCEPTION(store->destroy(msg)); } void MessageStoreModule::appendContent(intrusive_ptr<const PersistableMessage>& msg, const std::string& data) { - store->appendContent(msg, data); + TRANSFER_EXCEPTION(store->appendContent(msg, data)); } void MessageStoreModule::loadContent(const qpid::broker::PersistableQueue& queue, intrusive_ptr<const PersistableMessage>& msg, string& data, uint64_t offset, uint32_t length) { - store->loadContent(queue, msg, data, offset, length); + TRANSFER_EXCEPTION(store->loadContent(queue, msg, data, offset, length)); } void MessageStoreModule::enqueue(TransactionContext* ctxt, intrusive_ptr<PersistableMessage>& msg, const PersistableQueue& queue) { - store->enqueue(ctxt, msg, queue); + TRANSFER_EXCEPTION(store->enqueue(ctxt, msg, queue)); } void MessageStoreModule::dequeue(TransactionContext* ctxt, intrusive_ptr<PersistableMessage>& msg, const PersistableQueue& queue) { - store->dequeue(ctxt, msg, queue); + TRANSFER_EXCEPTION(store->dequeue(ctxt, msg, queue)); } void MessageStoreModule::flush(const qpid::broker::PersistableQueue& queue) { - store->flush(queue); + TRANSFER_EXCEPTION(store->flush(queue)); } u_int32_t MessageStoreModule::outstandingQueueAIO(const PersistableQueue& queue) { - return store->outstandingQueueAIO(queue); + TRANSFER_EXCEPTION(return store->outstandingQueueAIO(queue)); } std::auto_ptr<TransactionContext> MessageStoreModule::begin() { - return store->begin(); + TRANSFER_EXCEPTION(return store->begin()); } std::auto_ptr<TPCTransactionContext> MessageStoreModule::begin(const std::string& xid) { - return store->begin(xid); + TRANSFER_EXCEPTION(return store->begin(xid)); } void MessageStoreModule::prepare(TPCTransactionContext& txn) { - store->prepare(txn); + TRANSFER_EXCEPTION(store->prepare(txn)); } void MessageStoreModule::commit(TransactionContext& ctxt) { - store->commit(ctxt); + TRANSFER_EXCEPTION(store->commit(ctxt)); } void MessageStoreModule::abort(TransactionContext& ctxt) { - store->abort(ctxt); + TRANSFER_EXCEPTION(store->abort(ctxt)); } void MessageStoreModule::collectPreparedXids(std::set<std::string>& xids) { - store->collectPreparedXids(xids); + TRANSFER_EXCEPTION(store->collectPreparedXids(xids)); } |
