diff options
| author | Alan Conway <aconway@apache.org> | 2008-08-29 18:18:45 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-08-29 18:18:45 +0000 |
| commit | 9749e6774159c43750f04907574d371235e36c0a (patch) | |
| tree | a04aa3d5171ad59a82e82cec4a18e691dce56378 /cpp/src/qpid/broker/ConnectionFactory.cpp | |
| parent | 7a7273f69fdd328de06db16347914a20ae758b2b (diff) | |
| download | qpid-python-9749e6774159c43750f04907574d371235e36c0a.tar.gz | |
Refactored cluster to intercept at ConnectionCode, using sys:: interfaces rather than boost functions.
Use framing::Operations and Invoker to dispatch cluster methods.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@690358 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/ConnectionFactory.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/ConnectionFactory.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/ConnectionFactory.cpp b/cpp/src/qpid/broker/ConnectionFactory.cpp index 5de5a0230a..e6d8c49055 100644 --- a/cpp/src/qpid/broker/ConnectionFactory.cpp +++ b/cpp/src/qpid/broker/ConnectionFactory.cpp @@ -21,11 +21,14 @@ #include "ConnectionFactory.h" #include "qpid/framing/ProtocolVersion.h" #include "qpid/amqp_0_10/Connection.h" +#include "qpid/broker/Connection.h" namespace qpid { namespace broker { using framing::ProtocolVersion; +typedef std::auto_ptr<amqp_0_10::Connection> ConnectionPtr; +typedef std::auto_ptr<sys::ConnectionInputHandler> InputPtr; ConnectionFactory::ConnectionFactory(Broker& b) : broker(b) {} @@ -33,15 +36,21 @@ ConnectionFactory::~ConnectionFactory() {} sys::ConnectionCodec* ConnectionFactory::create(ProtocolVersion v, sys::OutputControl& out, const std::string& id) { - if (v == ProtocolVersion(0, 10)) - return new amqp_0_10::Connection(out, broker, id); + if (v == ProtocolVersion(0, 10)) { + ConnectionPtr c(new amqp_0_10::Connection(out, id, false)); + c->setInputHandler(InputPtr(new broker::Connection(c.get(), broker, id, false))); + return c.release(); + } return 0; } sys::ConnectionCodec* ConnectionFactory::create(sys::OutputControl& out, const std::string& id) { // used to create connections from one broker to another - return new amqp_0_10::Connection(out, broker, id, true); + ConnectionPtr c(new amqp_0_10::Connection(out, id, true)); + c->setInputHandler(InputPtr(new broker::Connection(c.get(), broker, id, true))); + return c.release(); } + }} // namespace qpid::broker |
