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.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cpp/lib/client/ClientChannel.cpp') diff --git a/cpp/lib/client/ClientChannel.cpp b/cpp/lib/client/ClientChannel.cpp index dd93c6ae8b..52910f5161 100644 --- a/cpp/lib/client/ClientChannel.cpp +++ b/cpp/lib/client/ClientChannel.cpp @@ -24,6 +24,7 @@ #include #include #include "Connection.h" +#include "AMQP_ServerProxy.h" // FIXME aconway 2007-01-26: Evaluate all throws, ensure consistent // handling of errors that should close the connection or the channel. @@ -48,12 +49,23 @@ Channel::~Channel(){ close(); } +AMQP_ServerProxy& Channel::brokerProxy() { + assert(proxy.get()); + return *proxy; +} + +AMQMethodBody::shared_ptr Channel::brokerResponse() { + // FIXME aconway 2007-02-08: implement responses. + return AMQMethodBody::shared_ptr(); +} + void Channel::open(ChannelId id, Connection& con) { if (isOpen()) THROW_QPID_ERROR(INTERNAL_ERROR, "Attempt to re-open channel "+id); connection = &con; init(id, con, con.getVersion()); // ChannelAdapter initialization. + proxy.reset(new AMQP_ServerProxy(*this)); string oob; if (id != 0) sendAndReceive(new ChannelOpenBody(version, oob)); -- cgit v1.2.1