00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _MessageStoreModule_
00022 #define _MessageStoreModule_
00023
00024 #include "MessageStore.h"
00025 #include "Queue.h"
00026 #include "RecoveryManager.h"
00027
00028 #include <boost/intrusive_ptr.hpp>
00029
00030 namespace qpid {
00031 namespace broker {
00032
00036 class MessageStoreModule : public MessageStore
00037 {
00038 MessageStore* store;
00039 public:
00040 MessageStoreModule(MessageStore* store);
00041
00042 bool init(const Options* options);
00043 std::auto_ptr<TransactionContext> begin();
00044 std::auto_ptr<TPCTransactionContext> begin(const std::string& xid);
00045 void prepare(TPCTransactionContext& txn);
00046 void commit(TransactionContext& txn);
00047 void abort(TransactionContext& txn);
00048 void collectPreparedXids(std::set<std::string>& xids);
00049
00050 void create(PersistableQueue& queue, const framing::FieldTable& args);
00051 void destroy(PersistableQueue& queue);
00052 void create(const PersistableExchange& exchange, const framing::FieldTable& args);
00053 void destroy(const PersistableExchange& exchange);
00054 void bind(const PersistableExchange& exchange, const PersistableQueue& queue,
00055 const std::string& key, const framing::FieldTable& args);
00056 void unbind(const PersistableExchange& exchange, const PersistableQueue& queue,
00057 const std::string& key, const framing::FieldTable& args);
00058 void create(const PersistableConfig& config);
00059 void destroy(const PersistableConfig& config);
00060 void recover(RecoveryManager& queues);
00061 void stage(const boost::intrusive_ptr<PersistableMessage>& msg);
00062 void destroy(PersistableMessage& msg);
00063 void appendContent(const boost::intrusive_ptr<const PersistableMessage>& msg, const std::string& data);
00064 void loadContent(const qpid::broker::PersistableQueue& queue,
00065 const boost::intrusive_ptr<const PersistableMessage>& msg, std::string& data,
00066 uint64_t offset, uint32_t length);
00067
00068 void enqueue(TransactionContext* ctxt,
00069 const boost::intrusive_ptr<PersistableMessage>& msg,
00070 const PersistableQueue& queue);
00071 void dequeue(TransactionContext* ctxt,
00072 const boost::intrusive_ptr<PersistableMessage>& msg,
00073 const PersistableQueue& queue);
00074 uint32_t outstandingQueueAIO(const PersistableQueue& queue);
00075 void flush(const qpid::broker::PersistableQueue& queue);
00076
00077 ~MessageStoreModule();
00078 };
00079
00080 }
00081 }
00082
00083
00084 #endif