summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/ha/QueueGuard.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2013-12-13 19:30:01 +0000
committerAlan Conway <aconway@apache.org>2013-12-13 19:30:01 +0000
commit50593c783fbcf9e85ae11152f159a7545beb0647 (patch)
tree6e08bec12c899a8e8b69b607956701612f2e8562 /cpp/src/qpid/ha/QueueGuard.cpp
parent7092d3934f79fcf1bb2d005437aee2f66064b2a3 (diff)
downloadqpid-python-50593c783fbcf9e85ae11152f159a7545beb0647.tar.gz
QPID-5421: Refactor: clean up QueueObservers.
Refactor of queue observers to use the broker::Observers base class. Simplifies Queue code and makes it more consistent with other observers (BrokerObservers, ConnectionObservers.) Modified Observers base class to allow identical locking behaviour to previous impementation. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1550818 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/ha/QueueGuard.cpp')
-rw-r--r--cpp/src/qpid/ha/QueueGuard.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpp/src/qpid/ha/QueueGuard.cpp b/cpp/src/qpid/ha/QueueGuard.cpp
index d2792e5e17..6ffd53ff21 100644
--- a/cpp/src/qpid/ha/QueueGuard.cpp
+++ b/cpp/src/qpid/ha/QueueGuard.cpp
@@ -55,8 +55,8 @@ QueueGuard::QueueGuard(broker::Queue& q, const BrokerInfo& info)
info.printId(os) << ": ";
logPrefix = os.str();
observer.reset(new QueueObserver(*this));
- queue.addObserver(observer);
- // Set first after calling addObserver so we know that the back of the
+ queue.getObservers().add(observer);
+ // Set first after adding the observer so we know that the back of the
// queue+1 is (or will be) a guarded position.
QueuePosition front, back;
q.getRange(front, back, broker::REPLICATOR);
@@ -86,7 +86,7 @@ void QueueGuard::dequeued(const Message& m) {
}
void QueueGuard::cancel() {
- queue.removeObserver(observer);
+ queue.getObservers().remove(observer);
Mutex::ScopedLock l(lock);
if (cancelled) return;
QPID_LOG(debug, logPrefix << "Cancelled");