From 8ac585d1a4cf8facf8eb1109f8e028ccde1b31f4 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 21 May 2009 11:28:54 +0000 Subject: * adjust replication exchange in line with change to registration function signature * make exchange type plugins register themselves on earlyInitialise; otherwise recovery of durable exchange occurs before plugins are initialised git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@777073 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/replication/ReplicationExchange.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'cpp/src/qpid/replication/ReplicationExchange.cpp') diff --git a/cpp/src/qpid/replication/ReplicationExchange.cpp b/cpp/src/qpid/replication/ReplicationExchange.cpp index 053a317743..613ab74d8c 100644 --- a/cpp/src/qpid/replication/ReplicationExchange.cpp +++ b/cpp/src/qpid/replication/ReplicationExchange.cpp @@ -38,8 +38,8 @@ const std::string SEQUENCE_VALUE("qpid.replication-event.sequence"); ReplicationExchange::ReplicationExchange(const std::string& name, bool durable, const FieldTable& _args, QueueRegistry& qr, - Manageable* parent) - : Exchange(name, durable, _args, parent), queues(qr), sequence(args.getAsInt64(SEQUENCE_VALUE)), init(false) + Manageable* parent, Broker* broker) + : Exchange(name, durable, _args, parent, broker), queues(qr), sequence(args.getAsInt64(SEQUENCE_VALUE)), init(false) { args.setInt64(SEQUENCE_VALUE, sequence); } @@ -156,31 +156,32 @@ struct ReplicationExchangePlugin : Plugin void initialize(Plugin::Target& target); Exchange::shared_ptr create(const std::string& name, bool durable, const framing::FieldTable& args, - management::Manageable* parent); + management::Manageable* parent, + qpid::broker::Broker* broker); }; ReplicationExchangePlugin::ReplicationExchangePlugin() : broker(0) {} Exchange::shared_ptr ReplicationExchangePlugin::create(const std::string& name, bool durable, const framing::FieldTable& args, - management::Manageable* parent) + management::Manageable* parent, qpid::broker::Broker* broker) { - Exchange::shared_ptr e(new ReplicationExchange(name, durable, args, broker->getQueues(), parent)); + Exchange::shared_ptr e(new ReplicationExchange(name, durable, args, broker->getQueues(), parent, broker)); return e; } -void ReplicationExchangePlugin::initialize(Plugin::Target& target) +void ReplicationExchangePlugin::earlyInitialize(Plugin::Target& target) { broker = dynamic_cast(&target); if (broker) { - ExchangeRegistry::FactoryFunction f = boost::bind(&ReplicationExchangePlugin::create, this, _1, _2, _3, _4); + ExchangeRegistry::FactoryFunction f = boost::bind(&ReplicationExchangePlugin::create, this, _1, _2, _3, _4, _5); broker->getExchanges().registerType(ReplicationExchange::typeName, f); QPID_LOG(info, "Registered replication exchange"); } } -void ReplicationExchangePlugin::earlyInitialize(Target&) {} +void ReplicationExchangePlugin::initialize(Target&) {} static ReplicationExchangePlugin exchangePlugin; -- cgit v1.2.1