diff options
author | Gordon Sim <gsim@apache.org> | 2009-05-21 11:28:54 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-05-21 11:28:54 +0000 |
commit | 8ac585d1a4cf8facf8eb1109f8e028ccde1b31f4 (patch) | |
tree | 1d33cceceaa24acba93d850e3ea42793095785fe /cpp/src/qpid/replication/ReplicationExchange.cpp | |
parent | f5b66fb89b36b98b803545908a6713a3728ac4e4 (diff) | |
download | qpid-python-8ac585d1a4cf8facf8eb1109f8e028ccde1b31f4.tar.gz |
* 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
Diffstat (limited to 'cpp/src/qpid/replication/ReplicationExchange.cpp')
-rw-r--r-- | cpp/src/qpid/replication/ReplicationExchange.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
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<broker::Broker*>(&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; |