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

71 lines
2.9 KiB
Java
Raw Normal View History

/*
* JBoss, Home of Professional Open Source
*
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* by the @author tags. See the COPYRIGHT.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.netty.channel;
/**
* Handles or intercepts a {@link ChannelEvent}, and sends a
2008-09-01 17:19:34 +02:00
* {@link ChannelEvent} to the next or previous 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 to the next
2009-06-17 11:13:10 +02:00
* or the previous handler or 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 (tlee@redhat.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.
}