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 "qpid/sys/Module.h"
00029
00030 #include <boost/intrusive_ptr.hpp>
00031
00032 namespace qpid {
00033 namespace broker {
00034
00038 class MessageStoreModule : public MessageStore
00039 {
00040 MessageStore* store;
00041 public:
00042 MessageStoreModule(MessageStore* store);
00043
00044 bool init(const Options* options);
00045 std::auto_ptr<TransactionContext> begin();
00046 std::auto_ptr<TPCTransactionContext> begin(const std::string& xid);
00047 void prepare(TPCTransactionContext& txn);
00048 void commit(TransactionContext& txn);
00049 void abort(TransactionContext& txn);
00050 void collectPreparedXids(std::set<std::string>& xids);
00051
00052 void create(PersistableQueue& queue, const framing::FieldTable& args);
00053 void destroy(PersistableQueue& queue);
00054 void create(const PersistableExchange& exchange, const framing::FieldTable& args);
00055 void destroy(const PersistableExchange& exchange);
00056 void bind(const PersistableExchange& exchange, const PersistableQueue& queue,
00057 const std::string& key, const framing::FieldTable& args);
00058 void unbind(const PersistableExchange& exchange, const PersistableQueue& queue,
00059 const std::string& key, const framing::FieldTable& args);
00060 void recover(RecoveryManager& queues);
00061 void stage(boost::intrusive_ptr<PersistableMessage>& msg);
00062 void destroy(PersistableMessage& msg);
00063 void appendContent(boost::intrusive_ptr<const PersistableMessage>& msg, const std::string& data);
00064 void loadContent(const qpid::broker::PersistableQueue& queue,
00065 boost::intrusive_ptr<const PersistableMessage>& msg, std::string& data,
00066 uint64_t offset, uint32_t length);
00067
00068 void enqueue(TransactionContext* ctxt, boost::intrusive_ptr<PersistableMessage>& msg,
00069 const PersistableQueue& queue);
00070 void dequeue(TransactionContext* ctxt, boost::intrusive_ptr<PersistableMessage>& msg,
00071 const PersistableQueue& queue);
00072 u_int32_t outstandingQueueAIO(const PersistableQueue& queue);
00073 void flush(const qpid::broker::PersistableQueue& queue);
00074
00075 ~MessageStoreModule();
00076 };
00077
00078 }
00079 }
00080
00081
00082 #endif