diff options
| author | Alan Conway <aconway@apache.org> | 2008-01-29 14:48:59 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-01-29 14:48:59 +0000 |
| commit | 6b6dfc1709eace6db0c624676ad297e34fef4aa7 (patch) | |
| tree | fb397c690916219439994edb19072ab5f6254a27 /cpp/src/qpid | |
| parent | ff63c19a83d95fa8f0116424d609e61df9085500 (diff) | |
| download | qpid-python-6b6dfc1709eace6db0c624676ad297e34fef4aa7.tar.gz | |
Deleted unused classes, adjusted files that still mention them.
D src/qpid/framing/ChannelAdapter.cpp
D src/qpid/framing/ChannelAdapter.h
D src/qpid/framing/HandlerUpdater.h
D src/tests/BrokerChannelTest.cpp
D src/tests/MockChannel.h
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@616353 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
| -rw-r--r-- | cpp/src/qpid/broker/Broker.cpp | 13 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/Broker.h | 13 | ||||
| -rw-r--r-- | cpp/src/qpid/cluster/Cluster.h | 3 | ||||
| -rw-r--r-- | cpp/src/qpid/cluster/ClusterPlugin.cpp | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/cluster/SessionManager.cpp | 5 | ||||
| -rw-r--r-- | cpp/src/qpid/cluster/SessionManager.h | 7 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/ChannelAdapter.cpp | 71 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/ChannelAdapter.h | 93 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/HandlerUpdater.h | 46 |
9 files changed, 8 insertions, 245 deletions
diff --git a/cpp/src/qpid/broker/Broker.cpp b/cpp/src/qpid/broker/Broker.cpp index 8edbb25cd5..06a0d33a85 100644 --- a/cpp/src/qpid/broker/Broker.cpp +++ b/cpp/src/qpid/broker/Broker.cpp @@ -35,7 +35,6 @@ #include "qpid/log/Statement.h" #include "qpid/Url.h" #include "qpid/framing/AMQFrame.h" -#include "qpid/framing/HandlerUpdater.h" #include "qpid/framing/ProtocolInitiation.h" #include "qpid/sys/Acceptor.h" #include "qpid/sys/ConnectionInputHandler.h" @@ -49,7 +48,6 @@ #include <memory> using qpid::sys::Acceptor; -using qpid::framing::HandlerUpdater; using qpid::framing::FrameHandler; using qpid::framing::ChannelId; using qpid::management::ManagementAgent; @@ -238,17 +236,6 @@ Acceptor& Broker::getAcceptor() const { return *acceptor; } -void Broker::add(const shared_ptr<HandlerUpdater>& updater) { - QPID_LOG(debug, "Broker added HandlerUpdater"); - handlerUpdaters.push_back(updater); -} - -void Broker::update(ChannelId channel, FrameHandler::Chains& chains) { - for_each(handlerUpdaters.begin(), handlerUpdaters.end(), - boost::bind(&HandlerUpdater::update, _1, - channel, boost::ref(chains))); -} - ManagementObject::shared_ptr Broker::GetManagementObject(void) const { return dynamic_pointer_cast<ManagementObject> (mgmtObject); diff --git a/cpp/src/qpid/broker/Broker.h b/cpp/src/qpid/broker/Broker.h index 32a3ea55f7..1917da83cc 100644 --- a/cpp/src/qpid/broker/Broker.h +++ b/cpp/src/qpid/broker/Broker.h @@ -46,11 +46,6 @@ #include <vector> namespace qpid { - -namespace framing { -class HandlerUpdater; -} - namespace broker { /** @@ -99,12 +94,6 @@ class Broker : public sys::Runnable, public Plugin::Target, public management::M /** Shut down the broker */ virtual void shutdown(); - /** Register a handler updater. */ - void add(const shared_ptr<framing::HandlerUpdater>&); - - /** Apply all handler updaters to a handler chain pair. */ - void update(framing::ChannelId, framing::FrameHandler::Chains&); - void setStore (MessageStore*); MessageStore& getStore() { return *store; } QueueRegistry& getQueues() { return queues; } @@ -125,13 +114,11 @@ class Broker : public sys::Runnable, public Plugin::Target, public management::M Options config; sys::Acceptor::shared_ptr acceptor; MessageStore* store; - typedef std::vector<shared_ptr<framing::HandlerUpdater> > HandlerUpdaters; QueueRegistry queues; ExchangeRegistry exchanges; ConnectionFactory factory; DtxManager dtxManager; - HandlerUpdaters handlerUpdaters; SessionManager sessionManager; management::ManagementAgent::shared_ptr managementAgent; management::Broker::shared_ptr mgmtObject; diff --git a/cpp/src/qpid/cluster/Cluster.h b/cpp/src/qpid/cluster/Cluster.h index 7e8cb2d435..1c53bcb9a7 100644 --- a/cpp/src/qpid/cluster/Cluster.h +++ b/cpp/src/qpid/cluster/Cluster.h @@ -64,7 +64,8 @@ class Cluster : public framing::FrameHandler, virtual ~Cluster(); - framing::HandlerUpdater& getHandlerUpdater() { return sessions; } + // FIXME aconway 2008-01-29: + //framing::HandlerUpdater& getHandlerUpdater() { return sessions; } /** Get the current cluster membership. */ MemberList getMembers() const; diff --git a/cpp/src/qpid/cluster/ClusterPlugin.cpp b/cpp/src/qpid/cluster/ClusterPlugin.cpp index 380bd7f632..35a07fbc2d 100644 --- a/cpp/src/qpid/cluster/ClusterPlugin.cpp +++ b/cpp/src/qpid/cluster/ClusterPlugin.cpp @@ -55,7 +55,7 @@ struct ClusterPlugin : public Plugin { if (broker && !options.clusterName.empty()) { assert(!cluster); // A process can only belong to one cluster. cluster = boost::in_place(options.clusterName, broker->getUrl(), boost::ref(*broker)); - broker->add(make_shared_ptr(&cluster->getHandlerUpdater(), nullDeleter)); + // broker->add(make_shared_ptr(&cluster->getHandlerUpdater(), nullDeleter)); } } }; diff --git a/cpp/src/qpid/cluster/SessionManager.cpp b/cpp/src/qpid/cluster/SessionManager.cpp index 71f52507b8..68e0223a40 100644 --- a/cpp/src/qpid/cluster/SessionManager.cpp +++ b/cpp/src/qpid/cluster/SessionManager.cpp @@ -25,7 +25,6 @@ #include "qpid/framing/AMQP_ServerOperations.h" #include "qpid/broker/BrokerAdapter.h" #include "qpid/broker/Connection.h" -#include "qpid/framing/ChannelAdapter.h" #include <boost/utility/in_place_factory.hpp> @@ -37,7 +36,7 @@ using namespace sys; using namespace broker; /** Handler to send frames direct to local broker (bypass correlation etc.) */ -struct SessionManager::BrokerHandler : public FrameHandler, private ChannelAdapter +struct SessionManager::BrokerHandler : public FrameHandler { Connection connection; SessionHandler sessionAdapter; @@ -56,7 +55,7 @@ struct SessionManager::BrokerHandler : public FrameHandler, private ChannelAdapt connection(0, broker), sessionAdapter(connection, 0), session(sessionAdapter, 1), - adapter(session, static_cast<ChannelAdapter&>(*this)) {} + adapter(session, 0) {} // FIXME aconway 2008-01-29: void handle(AMQFrame& frame) { AMQMethodBody* body=dynamic_cast<AMQMethodBody*>(frame.getBody()); diff --git a/cpp/src/qpid/cluster/SessionManager.h b/cpp/src/qpid/cluster/SessionManager.h index 10fe5f82d1..c0e0cb5736 100644 --- a/cpp/src/qpid/cluster/SessionManager.h +++ b/cpp/src/qpid/cluster/SessionManager.h @@ -21,7 +21,7 @@ #include "ClassifierHandler.h" -#include "qpid/framing/HandlerUpdater.h" +//FIXME aconway 2008-01-29: #include "qpid/framing/HandlerUpdater.h" #include "qpid/framing/FrameHandler.h" #include "qpid/sys/Mutex.h" @@ -45,10 +45,9 @@ namespace cluster { /** * Manage the clusters session map. - * + * // FIXME aconway 2008-01-29: HandlerUpdater */ -class SessionManager : public framing::HandlerUpdater, public framing::FrameHandler, - private boost::noncopyable +class SessionManager : public framing::FrameHandler, private boost::noncopyable { public: SessionManager(broker::Broker& broker, framing::FrameHandler& cluster); diff --git a/cpp/src/qpid/framing/ChannelAdapter.cpp b/cpp/src/qpid/framing/ChannelAdapter.cpp deleted file mode 100644 index a1e49a1904..0000000000 --- a/cpp/src/qpid/framing/ChannelAdapter.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed 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 "ChannelAdapter.h" -#include "OutputHandler.h" -#include "AMQFrame.h" -#include "FrameHandler.h" -#include "qpid/Exception.h" - -#include "AMQMethodBody.h" -#include "qpid/framing/ConnectionOpenBody.h" - -namespace qpid { -namespace framing { - -ChannelAdapter::Handler::Handler(ChannelAdapter& c) : parent(c) {} -void ChannelAdapter::Handler::handle(AMQFrame& f) { parent.handleBody(f.getBody()); } - -ChannelAdapter::ChannelAdapter() : handler(*this), id(0) {} - -void ChannelAdapter::init(ChannelId i, FrameHandler& out, ProtocolVersion v) -{ - assertChannelNotOpen(); - id = i; - version = v; - handlers.reset(&handler, &out); -} - -void ChannelAdapter::send(const AMQBody& body) -{ - assertChannelOpen(); - AMQFrame frame(body); - frame.setChannel(getId()); - handlers.out(frame); -} - -void ChannelAdapter::assertMethodOk(AMQMethodBody& method) const { - if (getId() != 0 && method.amqpClassId() == ConnectionOpenBody::CLASS_ID) - throw ChannelErrorException( - QPID_MSG("Connection method on non-0 channel " << getId())); -} - -void ChannelAdapter::assertChannelOpen() const { - if (getId() != 0 && !isOpen()) - throw ChannelErrorException( - QPID_MSG("Channel " << getId() << " is not open.")); -} - -void ChannelAdapter::assertChannelNotOpen() const { - if (getId() != 0 && isOpen()) - throw ChannelErrorException( - QPID_MSG("Channel " << getId() << " is already open.")); -} - -void ChannelAdapter::handle(AMQFrame& f) { handleBody(f.getBody()); } - -}} // namespace qpid::framing diff --git a/cpp/src/qpid/framing/ChannelAdapter.h b/cpp/src/qpid/framing/ChannelAdapter.h deleted file mode 100644 index 55fd08da9d..0000000000 --- a/cpp/src/qpid/framing/ChannelAdapter.h +++ /dev/null @@ -1,93 +0,0 @@ - - - -#ifndef _ChannelAdapter_ -#define _ChannelAdapter_ - -/* - * - * 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 "BodyHandler.h" -#include "ProtocolVersion.h" -#include "amqp_types.h" -#include "FrameHandler.h" - -namespace qpid { -namespace framing { - -/** - * Base class for client and broker channels. - * - * Provides in/out handler chains containing channel handlers. - * Chains may be modified by ChannelUpdaters registered with the broker. - * - * The handlers provided by the ChannelAdapter update request/response data. - * - * send() constructs a frame, updates request/resposne ID and forwards it - * to the out() chain. - * - * Thread safety: OBJECT UNSAFE. Instances must not be called - * concurrently. AMQP defines channels to be serialized. - */ -class ChannelAdapter : protected BodyHandler { - public: - /** - *@param output Processed frames are forwarded to this handler. - */ - ChannelAdapter(); - virtual ~ChannelAdapter() {} - - /** Initialize the channel adapter. */ - void init(ChannelId, FrameHandler&, ProtocolVersion); - - FrameHandler::Chains& getHandlers() { return handlers; } - - ChannelId getId() const { return id; } - ProtocolVersion getVersion() const { return version; } - - virtual void send(const AMQBody& body); - - virtual bool isOpen() const = 0; - - void handle(AMQFrame& f); - protected: - void assertMethodOk(AMQMethodBody& method) const; - void assertChannelOpen() const; - void assertChannelNotOpen() const; - - virtual void handleMethod(AMQMethodBody*) = 0; - - private: - struct Handler : public FrameHandler { - Handler(ChannelAdapter&); - void handle(AMQFrame&); - ChannelAdapter& parent; - }; - Handler handler; - ChannelId id; - ProtocolVersion version; - FrameHandler::Chains handlers; -}; - -}} - - -#endif diff --git a/cpp/src/qpid/framing/HandlerUpdater.h b/cpp/src/qpid/framing/HandlerUpdater.h deleted file mode 100644 index fb71c04fd6..0000000000 --- a/cpp/src/qpid/framing/HandlerUpdater.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef QPID_FRAMING_HANDLERUPDATER_H -#define QPID_FRAMING_HANDLERUPDATER_H - -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed 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 "qpid/Plugin.h" -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/FrameHandler.h" - -namespace qpid { -namespace framing { - -/** Interface for objects that can update handler chains. */ -struct HandlerUpdater { - virtual ~HandlerUpdater() {} - - /** Update the handler chains. - *@param channel Id of associated channel. - *@param chains Handler chains to be updated. - */ - virtual void update(ChannelId channel, FrameHandler::Chains& chains) = 0; -}; - -}} // namespace qpid::framing - - - - - -#endif /*!QPID_FRAMING_HANDLERUPDATER_H*/ |
