2008-08-08 02:37:18 +02:00
|
|
|
/*
|
2009-08-28 09:15:49 +02:00
|
|
|
* Copyright 2009 Red Hat, Inc.
|
2008-08-08 02:37:18 +02:00
|
|
|
*
|
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:
|
2008-08-08 02:37:18 +02:00
|
|
|
*
|
2009-08-28 09:15:49 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2008-08-08 03:27:24 +02:00
|
|
|
*
|
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.
|
2008-08-08 02:37:18 +02:00
|
|
|
*/
|
2008-08-08 03:40:10 +02:00
|
|
|
package org.jboss.netty.channel;
|
2008-08-08 02:37:18 +02:00
|
|
|
|
|
|
|
/**
|
2008-09-24 11:48:32 +02:00
|
|
|
* Handles or intercepts a {@link ChannelEvent}, and sends a
|
2009-09-03 06:33:15 +02:00
|
|
|
* {@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
|
|
|
*
|
2008-09-03 05:46:54 +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
|
2008-09-03 05:46:54 +02:00
|
|
|
* 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
|
2009-09-03 06:33:15 +02:00
|
|
|
* 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-08-08 02:37:18 +02:00
|
|
|
*
|
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
|
|
|
*
|
2008-08-08 03:27:24 +02:00
|
|
|
* @author The Netty Project (netty-dev@lists.jboss.org)
|
2009-10-14 07:46:40 +02:00
|
|
|
* @author Trustin Lee (trustin@gmail.com)
|
2008-08-08 02:37:18 +02:00
|
|
|
*
|
|
|
|
* @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\..*$
|
2008-08-08 02:37:18 +02:00
|
|
|
*/
|
|
|
|
public interface ChannelHandler {
|
2008-08-27 14:22:06 +02:00
|
|
|
// This is a tag interface.
|
2008-08-08 02:37:18 +02:00
|
|
|
}
|