diff options
author | Andrew Stitcher <astitcher@apache.org> | 2013-06-10 19:46:43 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2013-06-10 19:46:43 +0000 |
commit | 4f914ad72652cbe72f7f261915b74428365f2591 (patch) | |
tree | fca5ae058bd2090e7d9ae691eb6bbb662eda23d2 | |
parent | a81bb0f719deff15a7a0dd6b74ba06a381ca2222 (diff) | |
download | qpid-python-4f914ad72652cbe72f7f261915b74428365f2591.tar.gz |
QPID-4905: Tidy-up remove OutputHandler and directly use FrameHandler
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1491580 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/src/Makefile.am | 1 | ||||
-rw-r--r-- | cpp/src/qpid/amqp_0_10/Connection.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/amqp_0_10/Connection.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/broker/Connection.cpp | 4 | ||||
-rw-r--r-- | cpp/src/qpid/broker/Connection.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/client/ConnectionImpl.cpp | 4 | ||||
-rw-r--r-- | cpp/src/qpid/client/Connector.h | 6 | ||||
-rw-r--r-- | cpp/src/qpid/client/RdmaConnector.cpp | 6 | ||||
-rw-r--r-- | cpp/src/qpid/client/SslConnector.cpp | 4 | ||||
-rw-r--r-- | cpp/src/qpid/client/TCPConnector.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/client/TCPConnector.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/framing/OutputHandler.h | 42 | ||||
-rw-r--r-- | cpp/src/qpid/framing/amqp_framing.h | 1 | ||||
-rw-r--r-- | cpp/src/qpid/sys/ConnectionOutputHandler.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/sys/ConnectionOutputHandlerPtr.h | 2 |
15 files changed, 20 insertions, 64 deletions
diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am index 2a52403c55..ae7f90f1d5 100644 --- a/cpp/src/Makefile.am +++ b/cpp/src/Makefile.am @@ -433,7 +433,6 @@ libqpidcommon_la_SOURCES += \ qpid/framing/MethodBodyFactory.h \ qpid/framing/MethodContent.h \ qpid/framing/ModelMethod.h \ - qpid/framing/OutputHandler.h \ qpid/framing/ProtocolInitiation.cpp \ qpid/framing/ProtocolInitiation.h \ qpid/framing/ProtocolVersion.cpp \ diff --git a/cpp/src/qpid/amqp_0_10/Connection.cpp b/cpp/src/qpid/amqp_0_10/Connection.cpp index c95d1a2d1e..751ca15b74 100644 --- a/cpp/src/qpid/amqp_0_10/Connection.cpp +++ b/cpp/src/qpid/amqp_0_10/Connection.cpp @@ -132,7 +132,7 @@ void Connection::closed() { connection->closed(); } -void Connection::send(framing::AMQFrame& f) { +void Connection::handle(framing::AMQFrame& f) { { Mutex::ScopedLock l(frameQueueLock); if (!pushClosed) diff --git a/cpp/src/qpid/amqp_0_10/Connection.h b/cpp/src/qpid/amqp_0_10/Connection.h index 02137fc0f3..5f58df307d 100644 --- a/cpp/src/qpid/amqp_0_10/Connection.h +++ b/cpp/src/qpid/amqp_0_10/Connection.h @@ -69,7 +69,7 @@ class Connection : public sys::ConnectionCodec, void activateOutput(); void closed(); // connection closed by peer. void close(); // closing from this end. - void send(framing::AMQFrame&); + void handle(framing::AMQFrame&); framing::ProtocolVersion getVersion() const; }; diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index 03b9f1015d..5a42f371f1 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -484,9 +484,9 @@ void Connection::OutboundFrameTracker::close() { next->close(); } void Connection::OutboundFrameTracker::abort() { next->abort(); } void Connection::OutboundFrameTracker::connectionEstablished() { next->connectionEstablished(); } void Connection::OutboundFrameTracker::activateOutput() { next->activateOutput(); } -void Connection::OutboundFrameTracker::send(framing::AMQFrame& f) +void Connection::OutboundFrameTracker::handle(framing::AMQFrame& f) { - next->send(f); + next->handle(f); con.sent(f); } void Connection::OutboundFrameTracker::wrap(sys::ConnectionOutputHandlerPtr& p) diff --git a/cpp/src/qpid/broker/Connection.h b/cpp/src/qpid/broker/Connection.h index b1793e0cf4..5ab8632199 100644 --- a/cpp/src/qpid/broker/Connection.h +++ b/cpp/src/qpid/broker/Connection.h @@ -191,7 +191,7 @@ class Connection : public sys::ConnectionInputHandler, void abort(); void connectionEstablished(); void activateOutput(); - void send(framing::AMQFrame&); + void handle(framing::AMQFrame&); void wrap(sys::ConnectionOutputHandlerPtr&); private: Connection& con; diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp index 0abfbe09ec..dbb0a67d22 100644 --- a/cpp/src/qpid/client/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/ConnectionImpl.cpp @@ -192,7 +192,7 @@ ConnectionImpl::ConnectionImpl(framing::ProtocolVersion v, const ConnectionSetti released(false) { handler.in = boost::bind(&ConnectionImpl::incoming, this, _1); - handler.out = boost::bind(&Connector::send, boost::ref(connector), _1); + handler.out = boost::bind(&Connector::handle, boost::ref(connector), _1); handler.onClose = boost::bind(&ConnectionImpl::closed, this, CLOSE_CODE_NORMAL, std::string()); //only set error handler once open @@ -312,7 +312,7 @@ void ConnectionImpl::idleIn() void ConnectionImpl::idleOut() { AMQFrame frame((AMQHeartbeatBody())); - connector->send(frame); + connector->handle(frame); } void ConnectionImpl::close() diff --git a/cpp/src/qpid/client/Connector.h b/cpp/src/qpid/client/Connector.h index 16580f250c..1b5e59e06d 100644 --- a/cpp/src/qpid/client/Connector.h +++ b/cpp/src/qpid/client/Connector.h @@ -22,7 +22,7 @@ #define _Connector_ -#include "qpid/framing/OutputHandler.h" +#include "qpid/framing/FrameHandler.h" #include "qpid/framing/ProtocolVersion.h" #include <boost/shared_ptr.hpp> @@ -49,7 +49,7 @@ struct ConnectionSettings; class ConnectionImpl; ///@internal -class Connector : public framing::OutputHandler +class Connector : public framing::FrameHandler { public: // Protocol connector factory related stuff (it might be better to separate this code from the TCP Connector in the future) @@ -64,7 +64,7 @@ class Connector : public framing::OutputHandler virtual void connect(const std::string& host, const std::string& port) = 0; virtual void init() {}; virtual void close() = 0; - virtual void send(framing::AMQFrame& frame) = 0; + virtual void handle(framing::AMQFrame& frame) = 0; virtual void abort() = 0; virtual void setInputHandler(framing::InputHandler* handler) = 0; diff --git a/cpp/src/qpid/client/RdmaConnector.cpp b/cpp/src/qpid/client/RdmaConnector.cpp index 618fcf9e0b..1689b7aee2 100644 --- a/cpp/src/qpid/client/RdmaConnector.cpp +++ b/cpp/src/qpid/client/RdmaConnector.cpp @@ -70,7 +70,7 @@ class RdmaConnector : public Connector, public sys::Codec sys::ShutdownHandler* shutdownHandler; framing::InputHandler* input; framing::InitiationHandler* initialiser; - framing::OutputHandler* output; + framing::FrameHandler* output; Rdma::AsynchIO* aio; Rdma::Connector* acon; @@ -97,7 +97,7 @@ class RdmaConnector : public Connector, public sys::Codec void connect(const std::string& host, const std::string& port); void close(); - void send(framing::AMQFrame& frame); + void handle(framing::AMQFrame& frame); void abort() {} // TODO: need to fix this for heartbeat timeouts to work void setInputHandler(framing::InputHandler* handler); @@ -312,7 +312,7 @@ const std::string& RdmaConnector::getIdentifier() const { return identifier; } -void RdmaConnector::send(AMQFrame& frame) { +void RdmaConnector::handle(AMQFrame& frame) { // It is possible that we are called to write after we are already shutting down Mutex::ScopedLock l(dataConnectedLock); if (!dataConnected) return; diff --git a/cpp/src/qpid/client/SslConnector.cpp b/cpp/src/qpid/client/SslConnector.cpp index 59b17dc8f8..2e8842f24b 100644 --- a/cpp/src/qpid/client/SslConnector.cpp +++ b/cpp/src/qpid/client/SslConnector.cpp @@ -92,7 +92,7 @@ class SslConnector : public Connector void connectFailed(const std::string& msg); void close(); - void send(framing::AMQFrame& frame); + void handle(framing::AMQFrame& frame); void abort(); void connectAborted(); @@ -254,7 +254,7 @@ const std::string& SslConnector::getIdentifier() const { return identifier; } -void SslConnector::send(AMQFrame& frame) { +void SslConnector::handle(AMQFrame& frame) { bool notifyWrite = false; { Mutex::ScopedLock l(lock); diff --git a/cpp/src/qpid/client/TCPConnector.cpp b/cpp/src/qpid/client/TCPConnector.cpp index 777ba87348..2bdeec5b47 100644 --- a/cpp/src/qpid/client/TCPConnector.cpp +++ b/cpp/src/qpid/client/TCPConnector.cpp @@ -181,7 +181,7 @@ const std::string& TCPConnector::getIdentifier() const { return identifier; } -void TCPConnector::send(AMQFrame& frame) { +void TCPConnector::handle(AMQFrame& frame) { bool notifyWrite = false; { Mutex::ScopedLock l(lock); diff --git a/cpp/src/qpid/client/TCPConnector.h b/cpp/src/qpid/client/TCPConnector.h index 2a2fe031cd..20bd2fa5b8 100644 --- a/cpp/src/qpid/client/TCPConnector.h +++ b/cpp/src/qpid/client/TCPConnector.h @@ -78,7 +78,7 @@ class TCPConnector : public Connector, public sys::Codec void writeDataBlock(const framing::AMQDataBlock& data); void close(); - void send(framing::AMQFrame& frame); + void handle(framing::AMQFrame& frame); void abort(); void connectAborted(); diff --git a/cpp/src/qpid/framing/OutputHandler.h b/cpp/src/qpid/framing/OutputHandler.h deleted file mode 100644 index 88c95589da..0000000000 --- a/cpp/src/qpid/framing/OutputHandler.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _OutputHandler_ -#define _OutputHandler_ - -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -#include <boost/noncopyable.hpp> -#include "qpid/framing/FrameHandler.h" - -namespace qpid { -namespace framing { - -// TODO aconway 2007-08-29: Replace with FrameHandler. -class OutputHandler : public FrameHandler { - public: - virtual ~OutputHandler() {} - virtual void send(AMQFrame&) = 0; - void handle(AMQFrame& f) { send(f); } -}; - - -}} - - -#endif diff --git a/cpp/src/qpid/framing/amqp_framing.h b/cpp/src/qpid/framing/amqp_framing.h index 2e58922364..bad1c08a46 100644 --- a/cpp/src/qpid/framing/amqp_framing.h +++ b/cpp/src/qpid/framing/amqp_framing.h @@ -26,6 +26,5 @@ #include "qpid/framing/AMQContentBody.h" #include "qpid/framing/AMQHeartbeatBody.h" #include "qpid/framing/InputHandler.h" -#include "qpid/framing/OutputHandler.h" #include "qpid/framing/ProtocolInitiation.h" #include "qpid/framing/ProtocolVersion.h" diff --git a/cpp/src/qpid/sys/ConnectionOutputHandler.h b/cpp/src/qpid/sys/ConnectionOutputHandler.h index 74ac8882f0..3b1440d613 100644 --- a/cpp/src/qpid/sys/ConnectionOutputHandler.h +++ b/cpp/src/qpid/sys/ConnectionOutputHandler.h @@ -21,7 +21,7 @@ #ifndef _ConnectionOutputHandler_ #define _ConnectionOutputHandler_ -#include "qpid/framing/OutputHandler.h" +#include "qpid/framing/FrameHandler.h" #include "qpid/sys/OutputControl.h" namespace qpid { @@ -30,7 +30,7 @@ namespace sys { /** * Provides the output handler associated with a connection. */ -class ConnectionOutputHandler : public virtual qpid::framing::OutputHandler, public OutputControl +class ConnectionOutputHandler : public virtual qpid::framing::FrameHandler, public OutputControl { public: virtual void close() = 0; diff --git a/cpp/src/qpid/sys/ConnectionOutputHandlerPtr.h b/cpp/src/qpid/sys/ConnectionOutputHandlerPtr.h index 396c340c11..053f47df49 100644 --- a/cpp/src/qpid/sys/ConnectionOutputHandlerPtr.h +++ b/cpp/src/qpid/sys/ConnectionOutputHandlerPtr.h @@ -45,7 +45,7 @@ class ConnectionOutputHandlerPtr : public ConnectionOutputHandler void abort() { next->abort(); } void connectionEstablished() { next->connectionEstablished(); } void activateOutput() { next->activateOutput(); } - void send(framing::AMQFrame& f) { next->send(f); } + void handle(framing::AMQFrame& f) { next->handle(f); } private: ConnectionOutputHandler* next; |