diff options
author | Gordon Sim <gsim@apache.org> | 2009-01-07 20:50:35 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-01-07 20:50:35 +0000 |
commit | a86c15588f403dcc50613061b5e8cc5a18e9062d (patch) | |
tree | 64d81cd2635f110d18acf9b920ce6109ea7fb05a /cpp/src/qpid/broker/NullMessageStore.cpp | |
parent | 816a99518e8f22b404b95975a415ce0daff21f2a (diff) | |
download | qpid-python-a86c15588f403dcc50613061b5e8cc5a18e9062d.tar.gz |
Ensure that if no store is loaded we don't flow to disk, but revert to rejecting messages.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@732482 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/NullMessageStore.cpp')
-rw-r--r-- | cpp/src/qpid/broker/NullMessageStore.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/NullMessageStore.cpp b/cpp/src/qpid/broker/NullMessageStore.cpp index 4c13c2adef..ad0143ce43 100644 --- a/cpp/src/qpid/broker/NullMessageStore.cpp +++ b/cpp/src/qpid/broker/NullMessageStore.cpp @@ -20,8 +20,10 @@ */ #include "NullMessageStore.h" +#include "MessageStoreModule.h" #include "RecoveryManager.h" #include "qpid/log/Statement.h" +#include "qpid/framing/reply_exceptions.h" #include <iostream> @@ -90,7 +92,10 @@ void NullMessageStore::appendContent(const intrusive_ptr<const PersistableMessag void NullMessageStore::loadContent(const qpid::broker::PersistableQueue&, const intrusive_ptr<const PersistableMessage>&, - string&, uint64_t, uint32_t) {} + string&, uint64_t, uint32_t) +{ + throw qpid::framing::InternalErrorException("Can't load content; persistence not enabled"); +} void NullMessageStore::enqueue(TransactionContext*, const intrusive_ptr<PersistableMessage>& msg, @@ -149,8 +154,13 @@ bool NullMessageStore::isNull() const bool NullMessageStore::isNullStore(const MessageStore* store) { - const NullMessageStore* test = dynamic_cast<const NullMessageStore*>(store); - return test && test->isNull(); + const MessageStoreModule* wrapper = dynamic_cast<const MessageStoreModule*>(store); + if (wrapper) { + return wrapper->isNull(); + } else { + const NullMessageStore* test = dynamic_cast<const NullMessageStore*>(store); + return test && test->isNull(); + } } }} // namespace qpid::broker |