summaryrefslogtreecommitdiff
path: root/cpp/lib/broker
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2006-12-13 09:22:07 +0000
committerGordon Sim <gsim@apache.org>2006-12-13 09:22:07 +0000
commit39dd61bc66b531810160ef00de938846c27052c9 (patch)
tree17e773b91f7e5c98302a1e5d67fcc6398c67b2f0 /cpp/lib/broker
parenta775c87d5e2c5a6e1f8205541378ab3e1a0a8089 (diff)
downloadqpid-python-39dd61bc66b531810160ef00de938846c27052c9.tar.gz
Added prepared() method to MessageStore interface.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@486555 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/broker')
-rw-r--r--cpp/lib/broker/MessageStore.h5
-rw-r--r--cpp/lib/broker/MessageStoreModule.cpp5
-rw-r--r--cpp/lib/broker/MessageStoreModule.h5
-rw-r--r--cpp/lib/broker/NullMessageStore.cpp5
-rw-r--r--cpp/lib/broker/NullMessageStore.h5
5 files changed, 21 insertions, 4 deletions
diff --git a/cpp/lib/broker/MessageStore.h b/cpp/lib/broker/MessageStore.h
index acbff82c35..938f807a67 100644
--- a/cpp/lib/broker/MessageStore.h
+++ b/cpp/lib/broker/MessageStore.h
@@ -117,6 +117,11 @@ namespace qpid {
* place or null for 'local' transactions
*/
virtual void dequeue(TransactionContext* ctxt, Message* const msg, const Queue& queue, const std::string * const xid) = 0;
+
+ /**
+ * Treat all enqueue/dequeues where this xid was specified as being prepared.
+ */
+ virtual void prepared(const std::string * const xid) = 0;
/**
* Treat all enqueue/dequeues where this xid was specified as being committed.
*/
diff --git a/cpp/lib/broker/MessageStoreModule.cpp b/cpp/lib/broker/MessageStoreModule.cpp
index 1952786014..ccc5501379 100644
--- a/cpp/lib/broker/MessageStoreModule.cpp
+++ b/cpp/lib/broker/MessageStoreModule.cpp
@@ -73,6 +73,11 @@ void MessageStoreModule::dequeue(TransactionContext* ctxt, Message* const msg, c
store->dequeue(ctxt, msg, queue, xid);
}
+void MessageStoreModule::prepared(const string * const xid)
+{
+ store->prepared(xid);
+}
+
void MessageStoreModule::committed(const string * const xid)
{
store->committed(xid);
diff --git a/cpp/lib/broker/MessageStoreModule.h b/cpp/lib/broker/MessageStoreModule.h
index fcff71bd35..c49e06efa1 100644
--- a/cpp/lib/broker/MessageStoreModule.h
+++ b/cpp/lib/broker/MessageStoreModule.h
@@ -45,8 +45,9 @@ namespace qpid {
void loadContent(Message* const msg, std::string& data, u_int64_t offset, u_int32_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 committed(const string * const xid);
- void aborted(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);
diff --git a/cpp/lib/broker/NullMessageStore.cpp b/cpp/lib/broker/NullMessageStore.cpp
index a8318a4bf7..571ca7566b 100644
--- a/cpp/lib/broker/NullMessageStore.cpp
+++ b/cpp/lib/broker/NullMessageStore.cpp
@@ -75,6 +75,11 @@ void NullMessageStore::dequeue(TransactionContext*, Message* const, const Queue&
if (warn) std::cout << "WARNING: Can't dequeue message from '" << queue.getName() << "'. Persistence not enabled." << std::endl;
}
+void NullMessageStore::prepared(const string * const)
+{
+ if (warn) std::cout << "WARNING: Persistence not enabled." << std::endl;
+}
+
void NullMessageStore::committed(const string * const)
{
if (warn) std::cout << "WARNING: Persistence not enabled." << std::endl;
diff --git a/cpp/lib/broker/NullMessageStore.h b/cpp/lib/broker/NullMessageStore.h
index 913d6b0a8d..ef2bea8fd6 100644
--- a/cpp/lib/broker/NullMessageStore.h
+++ b/cpp/lib/broker/NullMessageStore.h
@@ -44,8 +44,9 @@ namespace qpid {
virtual void loadContent(Message* const msg, std::string& data, u_int64_t offset, u_int32_t length);
virtual void enqueue(TransactionContext* ctxt, Message* const msg, const Queue& queue, const string * const xid);
virtual void dequeue(TransactionContext* ctxt, Message* const msg, const Queue& queue, const string * const xid);
- virtual void committed(const string * const xid);
- virtual void aborted(const string * const xid);
+ virtual void prepared(const std::string * const xid);
+ virtual void committed(const std::string * const xid);
+ virtual void aborted(const std::string * const xid);
virtual std::auto_ptr<TransactionContext> begin();
virtual void commit(TransactionContext* ctxt);
virtual void abort(TransactionContext* ctxt);