From 9517deedff9691dbe3429b0b917dfd4208b0b1b8 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 13 Feb 2007 02:41:14 +0000 Subject: * gentools/templ.cpp/*Proxy*, CppGenerator.java: Changes to Proxy classes to make them directly usable as an API for low-level AMQP access. - Proxies hold reference to a ChannelAdapter not just an output handler. - Removed MethodContext parameter, makes no sense on requester end. - Return RequestId from request methods so caller can correlate incoming responses. - Add RequestId parameter to response methods so caller can provide correlation for outgoing responses. - No longer inherit from *Operations classes as the signatures no longer match. Proxy is for caller (client/requester) and Operations is for callee (server/responder) * cpp/lib/client/ClientChannel.h: Channel provides a raw proxy to the broker. Normal users will still use the Channel API to deal with the broker, but advanced users (incl ourselves!) can use the raw API to directly send and receive any AMQP message. * cpp/lib/broker/BrokerChannel,BrokerAdapter: Refactor for new proxies. broker::Channel is also a ClientProxy * Sundry files: - Pass ProtcolVersion by value, it is only two bytes. - Misc. const correctness fixes. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@506823 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/lib/client/ClientChannel.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'cpp/lib/client/ClientChannel.h') diff --git a/cpp/lib/client/ClientChannel.h b/cpp/lib/client/ClientChannel.h index a34c95d2c4..1c082f3b59 100644 --- a/cpp/lib/client/ClientChannel.h +++ b/cpp/lib/client/ClientChannel.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "sys/types.h" #include @@ -39,8 +40,10 @@ #include "Thread.h" namespace qpid { + namespace framing { class ChannelCloseBody; +class AMQP_ServerProxy; } namespace client { @@ -102,6 +105,7 @@ class Channel : public framing::ChannelAdapter, u_int16_t prefetch; const bool transactional; framing::ProtocolVersion version; + boost::scoped_ptr proxy; void enqueue(); void retrieve(Message& msg); @@ -151,8 +155,6 @@ class Channel : public framing::ChannelAdapter, public: - bool isOpen() const; - /** * Creates a channel object. * @@ -358,9 +360,21 @@ class Channel : public framing::ChannelAdapter, * @see publish() */ void setReturnedMessageHandler(ReturnedMessageHandler* handler); + + bool isOpen() const; + + /** + * Returns a proxy for the "raw" AMQP broker protocol. Only for use by + * protocol experts. + */ + + framing::AMQP_ServerProxy& brokerProxy(); + /** + * Wait for the next method from the broker. + */ + framing::AMQMethodBody::shared_ptr brokerResponse(); }; -} -} +}} #endif /*!_client_ClientChannel_h*/ -- cgit v1.2.1