summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2009-05-20 15:17:21 +0000
committerTed Ross <tross@apache.org>2009-05-20 15:17:21 +0000
commita2c01a4f2dc35aab8b905ad7efb5c62305e6d48b (patch)
tree141debb969aa98cc379bc6a78c41a9bf09ca6e71 /cpp
parent285ca60cf814ce4b96813e929ced910d53097aef (diff)
downloadqpid-python-a2c01a4f2dc35aab8b905ad7efb5c62305e6d48b.tar.gz
Fixed a regression affecting plugin-exchanges.
Plugin exchanges (i.e. the XML exchange) do not get the broker pointer and therefore can not register themselves with the management agent. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@776729 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/broker/ExchangeRegistry.cpp2
-rw-r--r--cpp/src/qpid/broker/ExchangeRegistry.h4
-rw-r--r--cpp/src/qpid/xml/XmlExchange.cpp6
-rw-r--r--cpp/src/qpid/xml/XmlExchange.h5
-rw-r--r--cpp/src/qpid/xml/XmlExchangePlugin.cpp8
5 files changed, 14 insertions, 11 deletions
diff --git a/cpp/src/qpid/broker/ExchangeRegistry.cpp b/cpp/src/qpid/broker/ExchangeRegistry.cpp
index 85bd65e456..59d516c089 100644
--- a/cpp/src/qpid/broker/ExchangeRegistry.cpp
+++ b/cpp/src/qpid/broker/ExchangeRegistry.cpp
@@ -60,7 +60,7 @@ pair<Exchange::shared_ptr, bool> ExchangeRegistry::declare(const string& name, c
if (i == factory.end()) {
throw UnknownExchangeTypeException();
} else {
- exchange = i->second(name, durable, args, parent);
+ exchange = i->second(name, durable, args, parent, broker);
}
}
exchanges[name] = exchange;
diff --git a/cpp/src/qpid/broker/ExchangeRegistry.h b/cpp/src/qpid/broker/ExchangeRegistry.h
index 34ee173a91..3dc8eef187 100644
--- a/cpp/src/qpid/broker/ExchangeRegistry.h
+++ b/cpp/src/qpid/broker/ExchangeRegistry.h
@@ -42,8 +42,8 @@ struct UnknownExchangeTypeException{};
class ExchangeRegistry{
public:
- typedef boost::function4<Exchange::shared_ptr, const std::string&,
- bool, const qpid::framing::FieldTable&, qpid::management::Manageable*> FactoryFunction;
+ typedef boost::function5<Exchange::shared_ptr, const std::string&,
+ bool, const qpid::framing::FieldTable&, qpid::management::Manageable*, qpid::broker::Broker*> FactoryFunction;
ExchangeRegistry (Broker* b = 0) : parent(0), broker(b) {}
QPID_BROKER_EXTERN std::pair<Exchange::shared_ptr, bool> declare
diff --git a/cpp/src/qpid/xml/XmlExchange.cpp b/cpp/src/qpid/xml/XmlExchange.cpp
index 4e9de49ad5..f17a11f08b 100644
--- a/cpp/src/qpid/xml/XmlExchange.cpp
+++ b/cpp/src/qpid/xml/XmlExchange.cpp
@@ -51,15 +51,15 @@ namespace qpid {
namespace broker {
-XmlExchange::XmlExchange(const string& _name, Manageable* _parent) : Exchange(_name, _parent)
+ XmlExchange::XmlExchange(const string& _name, Manageable* _parent, Broker* b) : Exchange(_name, _parent, b)
{
if (mgmtExchange != 0)
mgmtExchange->set_type (typeName);
}
XmlExchange::XmlExchange(const std::string& _name, bool _durable,
- const FieldTable& _args, Manageable* _parent) :
- Exchange(_name, _durable, _args, _parent)
+ const FieldTable& _args, Manageable* _parent, Broker* b) :
+ Exchange(_name, _durable, _args, _parent, b)
{
if (mgmtExchange != 0)
mgmtExchange->set_type (typeName);
diff --git a/cpp/src/qpid/xml/XmlExchange.h b/cpp/src/qpid/xml/XmlExchange.h
index 7bec480bde..38cb7699b6 100644
--- a/cpp/src/qpid/xml/XmlExchange.h
+++ b/cpp/src/qpid/xml/XmlExchange.h
@@ -37,6 +37,7 @@
namespace qpid {
namespace broker {
+class Broker;
class XmlExchange : public virtual Exchange {
typedef boost::shared_ptr<XQQuery> Query;
@@ -64,9 +65,9 @@ class XmlExchange : public virtual Exchange {
public:
static const std::string typeName;
- XmlExchange(const std::string& name, management::Manageable* parent = 0);
+ XmlExchange(const std::string& name, management::Manageable* parent = 0, Broker* broker = 0);
XmlExchange(const string& _name, bool _durable,
- const qpid::framing::FieldTable& _args, management::Manageable* parent = 0);
+ const qpid::framing::FieldTable& _args, management::Manageable* parent = 0, Broker* broker = 0);
virtual std::string getType() const { return typeName; }
diff --git a/cpp/src/qpid/xml/XmlExchangePlugin.cpp b/cpp/src/qpid/xml/XmlExchangePlugin.cpp
index d0ec9cb959..4bd3ed741e 100644
--- a/cpp/src/qpid/xml/XmlExchangePlugin.cpp
+++ b/cpp/src/qpid/xml/XmlExchangePlugin.cpp
@@ -31,13 +31,15 @@ namespace qpid {
namespace broker { // ACL uses the acl namespace here - should I?
using namespace std;
+class Broker;
Exchange::shared_ptr create(const std::string& name, bool durable,
const framing::FieldTable& args,
- management::Manageable* parent)
+ management::Manageable* parent,
+ Broker* broker)
{
- Exchange::shared_ptr e(new XmlExchange(name, durable, args, parent));
- return e;
+ Exchange::shared_ptr e(new XmlExchange(name, durable, args, parent, broker));
+ return e;
}