summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/ha/QueueReplicator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/ha/QueueReplicator.cpp')
-rw-r--r--cpp/src/qpid/ha/QueueReplicator.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/cpp/src/qpid/ha/QueueReplicator.cpp b/cpp/src/qpid/ha/QueueReplicator.cpp
index 1300819eb7..ffb40fdf22 100644
--- a/cpp/src/qpid/ha/QueueReplicator.cpp
+++ b/cpp/src/qpid/ha/QueueReplicator.cpp
@@ -108,6 +108,14 @@ class QueueReplicator::QueueObserver : public broker::QueueObserver {
boost::shared_ptr<QueueReplicator> queueReplicator;
};
+boost::shared_ptr<QueueReplicator> QueueReplicator::create(
+ HaBroker& hb, boost::shared_ptr<broker::Queue> q, boost::shared_ptr<broker::Link> l)
+{
+ boost::shared_ptr<QueueReplicator> qr(new QueueReplicator(hb, q, l));
+ qr->initialize();
+ return qr;
+}
+
QueueReplicator::QueueReplicator(HaBroker& hb,
boost::shared_ptr<Queue> q,
boost::shared_ptr<Link> l)
@@ -144,9 +152,7 @@ QueueReplicator::QueueReplicator(HaBroker& hb,
QueueReplicator::~QueueReplicator() {}
-// This must be called immediately after the constructor.
-// It has to be separate so we can call shared_from_this().
-void QueueReplicator::activate() {
+void QueueReplicator::initialize() {
Mutex::ScopedLock l(lock);
QPID_LOG(debug, logPrefix << "Created");
if (!queue) return; // Already destroyed