diff options
| author | Gordon Sim <gsim@apache.org> | 2006-11-07 11:26:50 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2006-11-07 11:26:50 +0000 |
| commit | c2a8f493b4d87c71dc04a432e686e2d9151a393f (patch) | |
| tree | 1bb137e50aa711e6ead9e70e9117f04916b32b07 /cpp/src/qpid/broker/Queue.cpp | |
| parent | e4ec69544d05f04c64b92d85905978495c1aee77 (diff) | |
| download | qpid-python-c2a8f493b4d87c71dc04a432e686e2d9151a393f.tar.gz | |
Made passing of transaction context in message store explicit (to avoid thread local storage in case this doesn't fit with new io design).
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@472067 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Queue.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/Queue.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index 7f3cfdc470..000552715b 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -35,7 +35,8 @@ Queue::Queue(const string& _name, u_int32_t _autodelete, dispatching(false), next(0), lastUsed(0), - exclusive(0) + exclusive(0), + persistenceId(0) { if(autodelete) lastUsed = Time::now().msecs(); } @@ -52,7 +53,7 @@ void Queue::bound(Binding* b){ } void Queue::deliver(Message::shared_ptr& msg){ - enqueue(msg, 0); + enqueue(0, msg, 0); process(msg); } @@ -163,15 +164,17 @@ bool Queue::canAutoDelete() const{ return lastUsed && (Time::now().msecs() - lastUsed > autodelete); } -void Queue::enqueue(Message::shared_ptr& msg, const string * const xid){ - if(store){ - store->enqueue(msg, *this, xid); +void Queue::enqueue(TransactionContext* ctxt, Message::shared_ptr& msg, const string * const xid) +{ + if(msg->isPersistent() && store){ + store->enqueue(ctxt, msg, *this, xid); } } -void Queue::dequeue(Message::shared_ptr& msg, const string * const xid){ - if(store){ - store->dequeue(msg, *this, xid); +void Queue::dequeue(TransactionContext* ctxt, Message::shared_ptr& msg, const string * const xid) +{ + if(msg->isPersistent() && store){ + store->dequeue(ctxt, msg, *this, xid); } } |
