netty5/src/main/java/org/jboss/netty/channel/ChannelHandler.java

63 lines
2.5 KiB
Java
Raw Normal View History

/*
2009-08-28 09:15:49 +02:00
* Copyright 2009 Red Hat, Inc.
*
2009-08-28 09:15:49 +02:00
* Red Hat 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:
*
2009-08-28 09:15:49 +02:00
* http://www.apache.org/licenses/LICENSE-2.0
*
2009-08-28 09:15:49 +02:00
* 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.
*/
package org.jboss.netty.channel;
/**
* Handles or intercepts a {@link ChannelEvent}, and sends a
* {@link ChannelEvent} to the next handler in a {@link ChannelPipeline}.
2008-09-02 16:12:56 +02:00
*
* <h3>Sub-types</h3>
2008-09-01 16:29:17 +02:00
* <p>
2009-04-28 15:35:55 +02:00
* {@link ChannelHandler} itself does not provide any method. To handle a
* {@link ChannelEvent} you need to implement its sub-interfaces. There are
* two sub-interfaces which handles a received event, one for upstream events
* and the other for downstream events:
2008-09-01 16:29:17 +02:00
* <ul>
2008-11-14 09:02:42 +01:00
* <li>{@link ChannelUpstreamHandler} handles and intercepts an upstream {@link ChannelEvent}.</li>
2008-09-02 16:12:56 +02:00
* <li>{@link ChannelDownstreamHandler} handles and intercepts a downstream {@link ChannelEvent}.</li>
2008-09-01 16:29:17 +02:00
* </ul>
2008-09-02 16:12:56 +02:00
*
* You will also find more detailed explanation from the documentation of
2009-04-28 15:35:55 +02:00
* each sub-interface on how an event is interpreted when it goes upstream and
* downstream respectively.
*
2008-09-02 16:12:56 +02:00
* <h3>The context object</h3>
2008-09-02 14:04:04 +02:00
* <p>
* A {@link ChannelHandler} is provided with a {@link ChannelHandlerContext}
2009-06-17 11:13:10 +02:00
* object. A {@link ChannelHandler} is supposed to interact with the
* {@link ChannelPipeline} it belongs to via a context object. Using the
* context object, the {@link ChannelHandler} can pass events upstream or
* downstream, modify the behavior of the pipeline, or store the information
* (attachment) which is specific to the handler.
*
2008-09-02 16:12:56 +02:00
* <h3>Additional resources worth reading</h3>
* <p>
2009-06-17 11:13:10 +02:00
* Please refer to the {@link ChannelEvent} and {@link ChannelPipeline} to find
* out what a upstream event and a downstream event are, what fundamental
* differences they have, and how they flow in a pipeline.
2008-09-02 16:12:56 +02:00
*
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (trustin@gmail.com)
*
* @version $Rev$, $Date$
2008-09-05 12:58:37 +02:00
*
* @apiviz.landmark
2009-04-28 15:35:55 +02:00
* @apiviz.exclude ^org\.jboss\.netty\.handler\..*$
*/
public interface ChannelHandler {
2008-08-27 14:22:06 +02:00
// This is a tag interface.
}