diff options
author | Gordon Sim <gsim@apache.org> | 2007-03-30 15:50:07 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-03-30 15:50:07 +0000 |
commit | 72bca07ee53fb9476f268133f244d55d8f53d3b9 (patch) | |
tree | 6e8400200b22188899144a025ecb1a6c5922cc7b /qpid/cpp/lib/broker/MessageStoreModule.h | |
parent | 61c7761f005dacfc5938a4d4d25b7120a8e21620 (diff) | |
download | qpid-python-72bca07ee53fb9476f268133f244d55d8f53d3b9.tar.gz |
Refactored the MessageStore interface to restrict visibility of broker core from store implementations.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@524139 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/lib/broker/MessageStoreModule.h')
-rw-r--r-- | qpid/cpp/lib/broker/MessageStoreModule.h | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/qpid/cpp/lib/broker/MessageStoreModule.h b/qpid/cpp/lib/broker/MessageStoreModule.h index 27fedbf635..1787a4f361 100644 --- a/qpid/cpp/lib/broker/MessageStoreModule.h +++ b/qpid/cpp/lib/broker/MessageStoreModule.h @@ -28,32 +28,39 @@ #include <sys/Module.h> namespace qpid { - namespace broker { - /** - * A null implementation of the MessageStore interface - */ - class MessageStoreModule : public MessageStore{ - qpid::sys::Module<MessageStore> store; - public: - MessageStoreModule(const std::string& name); - void create(const Queue& queue, const qpid::framing::FieldTable& settings); - void destroy(const Queue& queue); - void recover(RecoveryManager& queues, const MessageStoreSettings* const settings = 0); - void stage(Message* const msg); - void destroy(Message* const msg); - void appendContent(Message* const msg, const std::string& data); - void loadContent(Message* const msg, std::string& data, uint64_t offset, uint32_t length); - void enqueue(TransactionContext* ctxt, Message* const msg, const Queue& queue, const string * const xid); - void dequeue(TransactionContext* ctxt, Message* const msg, const Queue& queue, const string * const xid); - void prepared(const std::string * const xid); - void committed(const std::string * const xid); - void aborted(const std::string * const xid); - std::auto_ptr<TransactionContext> begin(); - void commit(TransactionContext* ctxt); - void abort(TransactionContext* ctxt); - ~MessageStoreModule(){} - }; - } +namespace broker { + +/** + * A null implementation of the MessageStore interface + */ +class MessageStoreModule : public MessageStore +{ + qpid::sys::Module<MessageStore> store; +public: + MessageStoreModule(const std::string& name); + + std::auto_ptr<TransactionContext> begin(); + std::auto_ptr<TPCTransactionContext> begin(const std::string& xid); + void prepare(TPCTransactionContext& txn); + void commit(TransactionContext& txn); + void abort(TransactionContext& txn); + + void create(const PersistableQueue& queue); + void destroy(const PersistableQueue& queue); + void create(const PersistableExchange& exchange); + void destroy(const PersistableExchange& exchange); + void recover(RecoveryManager& queues); + void stage(PersistableMessage& msg); + void destroy(PersistableMessage& msg); + void appendContent(PersistableMessage& msg, const std::string& data); + void loadContent(PersistableMessage& msg, std::string& data, uint64_t offset, uint32_t length); + void enqueue(TransactionContext* ctxt, PersistableMessage& msg, const PersistableQueue& queue); + void dequeue(TransactionContext* ctxt, PersistableMessage& msg, const PersistableQueue& queue); + + ~MessageStoreModule(){} +}; + +} } |