diff options
author | Gordon Sim <gsim@apache.org> | 2007-07-17 08:28:48 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-07-17 08:28:48 +0000 |
commit | ce9743f8f1640d42af5fe7aaa8fe7e3ca82a914d (patch) | |
tree | ea71b96a92eb5402b71a4c08312fbe1d8b835bbc /cpp/src/qpid/broker/MessageHandlerImpl.cpp | |
parent | 54b8fe305e87f623bbeb2c50bea20a332f71a983 (diff) | |
download | qpid-python-ce9743f8f1640d42af5fe7aaa8fe7e3ca82a914d.tar.gz |
Some refactoring towards a more decoupled handler chain structure:
* Connection no longer depends on Channel; it contains a map of
FrameHandler::Chains. (The construction of the chains still refers
to specific handlers).
* Channel is no longer tied to ChannelAdapter through inheritance. The
former is independent of any particular handler chain or protocol
version, the latter is still used by ConnectionAdapter and
SemanticHandler in the 0-9 chain.
* A DeliveryAdapter interface has been introduced as part of the
separation of ChannelAdapter from Channel. This is intended to adapt
from a version independent core to version specific mechanisms for
sending messages. i.e. it fulfills the same role for outputs that
e.g. BrokerAdapter does for inputs. (Its not perfect yet by any
means but is a step on the way to the correct model I think).
* The connection related methods sent over channel zero are
implemented in their own adapter (ConnectionAdapter), and are
entirely separate from the semantic layer. The channel control
methods are still bundled with the proper semantic layer methods;
they too can be separated but would have to share the request id
with the semantic method handler due to the nature of the 0-9 WIP.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@556846 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/MessageHandlerImpl.cpp')
-rw-r--r-- | cpp/src/qpid/broker/MessageHandlerImpl.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/MessageHandlerImpl.cpp b/cpp/src/qpid/broker/MessageHandlerImpl.cpp index bbfcf209ad..f586ea92fc 100644 --- a/cpp/src/qpid/broker/MessageHandlerImpl.cpp +++ b/cpp/src/qpid/broker/MessageHandlerImpl.cpp @@ -21,6 +21,8 @@ #include "BrokerChannel.h" #include "qpid/framing/FramingContent.h" #include "Connection.h" +#include "ConsumeAdapter.h" +#include "GetAdapter.h" #include "Broker.h" #include "BrokerMessageMessage.h" #include "qpid/framing/MessageAppendBody.h" @@ -127,7 +129,7 @@ MessageHandlerImpl::consume(const MethodContext& context, if(!destination.empty() && channel.exists(destination)) throw ConnectionException(530, "Consumer tags must be unique"); string tag = destination; - channel.consume( + channel.consume(std::auto_ptr<DeliveryAdapter>(new ConsumeAdapter(adapter, destination, connection.getFrameMax())), tag, queue, !noAck, exclusive, noLocal ? &connection : 0, &filter); client.ok(context.getRequestId()); @@ -144,7 +146,8 @@ MessageHandlerImpl::get( const MethodContext& context, { Queue::shared_ptr queue = getQueue(queueName); - if(channel.get(queue, destination, !noAck)) + GetAdapter out(adapter, queue, destination, connection.getFrameMax()); + if(channel.get(out, queue, !noAck)) client.ok(context.getRequestId()); else client.empty(context.getRequestId()); @@ -162,7 +165,7 @@ MessageHandlerImpl::empty( const MethodContext& ) void MessageHandlerImpl::ok(const MethodContext& /*context*/) { - channel.ack(); + channel.ack(adapter.getFirstAckRequest(), adapter.getLastAckRequest()); } void @@ -190,7 +193,7 @@ MessageHandlerImpl::reject(const MethodContext& /*context*/, uint16_t /*code*/, const string& /*text*/ ) { - channel.ack(); + //channel.ack(); // channel.requeue(); } |