diff options
author | Gordon Sim <gsim@apache.org> | 2013-03-14 19:36:26 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2013-03-14 19:36:26 +0000 |
commit | 3c22a7e7a58c883cdb0575afb30c6658344d4e2b (patch) | |
tree | 0570d45f59f36063f9c44073d807e9f5ec4bfe1d /qpid/cpp/src/qpid/broker/amqp/Outgoing.h | |
parent | 125e49d4df65142a89b69e7d367b34f01ea354a1 (diff) | |
download | qpid-python-3c22a7e7a58c883cdb0575afb30c6658344d4e2b.tar.gz |
QPID-4586: add ability to have qpidd establish outgoing connections
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1456621 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/broker/amqp/Outgoing.h')
-rw-r--r-- | qpid/cpp/src/qpid/broker/amqp/Outgoing.h | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/qpid/cpp/src/qpid/broker/amqp/Outgoing.h b/qpid/cpp/src/qpid/broker/amqp/Outgoing.h index 7d845a1427..b8a689b8f8 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Outgoing.h +++ b/qpid/cpp/src/qpid/broker/amqp/Outgoing.h @@ -41,7 +41,7 @@ class Broker; class Queue; class Selector; namespace amqp { -class ManagedSession; +class Session; template <class T> class CircularArray { @@ -56,17 +56,43 @@ class CircularArray size_t next; }; +class Outgoing : public ManagedOutgoingLink +{ + public: + Outgoing(Broker& broker, Session& parent, const std::string& source, const std::string& name); + virtual void setSubjectFilter(const std::string&) = 0; + virtual void setSelectorFilter(const std::string&) = 0; + virtual void init() = 0; + /** + * Allows the link to initiate any outgoing transfers + */ + virtual bool doWork() = 0; + /** + * Signals that this link has been detached + */ + virtual void detached() = 0; + /** + * Called when a delivery is writable + */ + virtual void handle(pn_delivery_t* delivery) = 0; + void wakeup(); + virtual ~Outgoing() {} + private: + Session& session; +}; + /** - * + * Logic for handling an outgoing link from a queue (even if it is a + * subscription pseduo-queue created by the broker) */ -class Outgoing : public qpid::broker::Consumer, public boost::enable_shared_from_this<Outgoing>, public ManagedOutgoingLink +class OutgoingFromQueue : public Outgoing, public qpid::broker::Consumer, public boost::enable_shared_from_this<OutgoingFromQueue> { public: - Outgoing(Broker&,boost::shared_ptr<Queue> q, pn_link_t* l, ManagedSession&, qpid::sys::OutputControl& o, bool topic); + OutgoingFromQueue(Broker&, const std::string& source, boost::shared_ptr<Queue> q, pn_link_t* l, Session&, qpid::sys::OutputControl& o, bool topic); void setSubjectFilter(const std::string&); void setSelectorFilter(const std::string&); void init(); - bool dispatch(); + bool doWork(); void write(const char* data, size_t size); void handle(pn_delivery_t* delivery); bool canDeliver(); |