From 33d8343d134a391fa7d0a338fafad1a22ff58dc3 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 30 Mar 2007 15:50:07 +0000 Subject: 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/qpid@524139 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/lib/broker/MessageStoreModule.h | 59 +++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 26 deletions(-) (limited to 'cpp/lib/broker/MessageStoreModule.h') diff --git a/cpp/lib/broker/MessageStoreModule.h b/cpp/lib/broker/MessageStoreModule.h index 27fedbf635..1787a4f361 100644 --- a/cpp/lib/broker/MessageStoreModule.h +++ b/cpp/lib/broker/MessageStoreModule.h @@ -28,32 +28,39 @@ #include namespace qpid { - namespace broker { - /** - * A null implementation of the MessageStore interface - */ - class MessageStoreModule : public MessageStore{ - qpid::sys::Module 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 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 store; +public: + MessageStoreModule(const std::string& name); + + std::auto_ptr begin(); + std::auto_ptr 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(){} +}; + +} } -- cgit v1.2.1