summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-05-21 11:28:54 +0000
committerGordon Sim <gsim@apache.org>2009-05-21 11:28:54 +0000
commit8ac585d1a4cf8facf8eb1109f8e028ccde1b31f4 (patch)
tree1d33cceceaa24acba93d850e3ea42793095785fe
parentf5b66fb89b36b98b803545908a6713a3728ac4e4 (diff)
downloadqpid-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
-rw-r--r--cpp/src/qpid/replication/ReplicationExchange.cpp17
-rw-r--r--cpp/src/qpid/replication/ReplicationExchange.h3
-rw-r--r--cpp/src/qpid/xml/XmlExchangePlugin.cpp4
3 files changed, 13 insertions, 11 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;
diff --git a/cpp/src/qpid/replication/ReplicationExchange.h b/cpp/src/qpid/replication/ReplicationExchange.h
index 4cc45ed5f5..ab36704e06 100644
--- a/cpp/src/qpid/replication/ReplicationExchange.h
+++ b/cpp/src/qpid/replication/ReplicationExchange.h
@@ -42,7 +42,8 @@ class ReplicationExchange : public qpid::broker::Exchange
ReplicationExchange(const std::string& name, bool durable,
const qpid::framing::FieldTable& args,
qpid::broker::QueueRegistry& queues,
- qpid::management::Manageable* parent = 0);
+ qpid::management::Manageable* parent = 0,
+ qpid::broker::Broker* broker = 0);
std::string getType() const;
diff --git a/cpp/src/qpid/xml/XmlExchangePlugin.cpp b/cpp/src/qpid/xml/XmlExchangePlugin.cpp
index 4bd3ed741e..8f2d127424 100644
--- a/cpp/src/qpid/xml/XmlExchangePlugin.cpp
+++ b/cpp/src/qpid/xml/XmlExchangePlugin.cpp
@@ -51,7 +51,7 @@ public:
};
-void XmlExchangePlugin::initialize(Plugin::Target& target)
+void XmlExchangePlugin::earlyInitialize(Plugin::Target& target)
{
Broker* broker = dynamic_cast<broker::Broker*>(&target);
if (broker) {
@@ -60,7 +60,7 @@ void XmlExchangePlugin::initialize(Plugin::Target& target)
}
}
-void XmlExchangePlugin::earlyInitialize(Target&) {}
+void XmlExchangePlugin::initialize(Target&) {}
static XmlExchangePlugin matchingPlugin;