summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-08-31 20:51:22 +0000
committerAlan Conway <aconway@apache.org>2007-08-31 20:51:22 +0000
commit761e10501fe5ea51f9d8c40d9a200ae27193ab23 (patch)
treee2d4bdfdc0b9383661947378a1f183387501637c /cpp/src/qpid/framing
parent655b3b5806bafdd784f6a9c242e26341bd6aeccc (diff)
downloadqpid-python-761e10501fe5ea51f9d8c40d9a200ae27193ab23.tar.gz
* Summary:
- Moved BrokerChannel functionality into Session. - Moved ChannelHandler methods handling into SessionAdapter. - Updated all handlers to use session. (We're still using AMQP channel methods in SessionAdapter) Roles & responsibilities: Session: - represents an _open_ session, may be active or suspended. - ows all session state including handler chains. - attahced to SessionAdapter when active, not when suspended. SessionAdapter: - reprents the association of a channel with a session. - owned by Connection, kept in the session map. - channel open == SessionAdapter.getSessio() != 0 Anything that depends on attachment to a channel, connection or protocol should be in SessionAdpater. Anything that suvives a session suspend belongs in Session. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@571575 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing')
-rw-r--r--cpp/src/qpid/framing/AMQContentBody.cpp3
-rw-r--r--cpp/src/qpid/framing/AMQFrame.h5
-rw-r--r--cpp/src/qpid/framing/ChannelAdapter.cpp2
-rw-r--r--cpp/src/qpid/framing/ChannelAdapter.h5
4 files changed, 9 insertions, 6 deletions
diff --git a/cpp/src/qpid/framing/AMQContentBody.cpp b/cpp/src/qpid/framing/AMQContentBody.cpp
index c472af555d..b0850ea434 100644
--- a/cpp/src/qpid/framing/AMQContentBody.cpp
+++ b/cpp/src/qpid/framing/AMQContentBody.cpp
@@ -40,4 +40,7 @@ void qpid::framing::AMQContentBody::decode(Buffer& buffer, uint32_t _size){
void qpid::framing::AMQContentBody::print(std::ostream& out) const
{
out << "content (" << size() << " bytes)";
+#ifndef NDEBUG
+ out << data.substr(0,10);
+#endif
}
diff --git a/cpp/src/qpid/framing/AMQFrame.h b/cpp/src/qpid/framing/AMQFrame.h
index 84e7660218..8c18475d29 100644
--- a/cpp/src/qpid/framing/AMQFrame.h
+++ b/cpp/src/qpid/framing/AMQFrame.h
@@ -52,7 +52,10 @@ class AMQFrame : public AMQDataBlock
void setChannel(ChannelId c) { channel = c; }
AMQBody* getBody();
- const AMQBody* getBody() const;
+ const AMQBody* getBody() const;
+
+ AMQMethodBody* getMethod() { return getBody()->getMethod(); }
+ const AMQMethodBody* getMethod() const { return getBody()->getMethod(); }
/** Copy a body instance to the frame */
void setBody(const AMQBody& b) { CopyVisitor cv(*this); b.accept(cv); }
diff --git a/cpp/src/qpid/framing/ChannelAdapter.cpp b/cpp/src/qpid/framing/ChannelAdapter.cpp
index 027679228a..6a466fdfab 100644
--- a/cpp/src/qpid/framing/ChannelAdapter.cpp
+++ b/cpp/src/qpid/framing/ChannelAdapter.cpp
@@ -36,7 +36,7 @@ void ChannelAdapter::Handler::handle(AMQFrame& f) { parent.handleBody(f.getBody(
ChannelAdapter::ChannelAdapter() : handler(*this), id(0) {}
-void ChannelAdapter::init(ChannelId i, OutputHandler& out, ProtocolVersion v)
+void ChannelAdapter::init(ChannelId i, FrameHandler& out, ProtocolVersion v)
{
assertChannelNotOpen();
id = i;
diff --git a/cpp/src/qpid/framing/ChannelAdapter.h b/cpp/src/qpid/framing/ChannelAdapter.h
index 82f7115001..55fd08da9d 100644
--- a/cpp/src/qpid/framing/ChannelAdapter.h
+++ b/cpp/src/qpid/framing/ChannelAdapter.h
@@ -29,13 +29,10 @@
#include "ProtocolVersion.h"
#include "amqp_types.h"
#include "FrameHandler.h"
-#include "OutputHandler.h"
namespace qpid {
namespace framing {
-class OutputHandler;
-
/**
* Base class for client and broker channels.
*
@@ -59,7 +56,7 @@ class ChannelAdapter : protected BodyHandler {
virtual ~ChannelAdapter() {}
/** Initialize the channel adapter. */
- void init(ChannelId, OutputHandler&, ProtocolVersion);
+ void init(ChannelId, FrameHandler&, ProtocolVersion);
FrameHandler::Chains& getHandlers() { return handlers; }