You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2009/05/21 13:28:55 UTC

svn commit: r777073 - in /qpid/trunk/qpid/cpp/src/qpid: replication/ReplicationExchange.cpp replication/ReplicationExchange.h xml/XmlExchangePlugin.cpp

Author: gsim
Date: Thu May 21 11:28:54 2009
New Revision: 777073

URL: http://svn.apache.org/viewvc?rev=777073&view=rev
Log:
* 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

Modified:
    qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp
    qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.h
    qpid/trunk/qpid/cpp/src/qpid/xml/XmlExchangePlugin.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp?rev=777073&r1=777072&r2=777073&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.cpp Thu May 21 11:28:54 2009
@@ -38,8 +38,8 @@
 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 @@
     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;
 

Modified: qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.h?rev=777073&r1=777072&r2=777073&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/replication/ReplicationExchange.h Thu May 21 11:28:54 2009
@@ -42,7 +42,8 @@
     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;
 

Modified: qpid/trunk/qpid/cpp/src/qpid/xml/XmlExchangePlugin.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/xml/XmlExchangePlugin.cpp?rev=777073&r1=777072&r2=777073&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/xml/XmlExchangePlugin.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/xml/XmlExchangePlugin.cpp Thu May 21 11:28:54 2009
@@ -51,7 +51,7 @@
 };
   
 
-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::earlyInitialize(Target&) {}
+void XmlExchangePlugin::initialize(Target&) {}
 
 
 static XmlExchangePlugin matchingPlugin;



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org