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/framing | |
| 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/framing')
| -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 |
3 files changed, 0 insertions, 210 deletions
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*/ |
