org.jboss.netty.channel

## Interface LifeCycleAwareChannelHandler

- All Superinterfaces:
    ChannelHandler
  All Known Implementing Classes:
    BufferedWriteHandler, ChunkedWriteHandler, CompatibleMarshallingDecoder, CompatibleObjectDecoder, DelimiterBasedFrameDecoder, FixedLengthFrameDecoder, FrameDecoder, HttpChunkAggregator, HttpContentCompressor, HttpContentDecoder, HttpContentDecompressor, HttpContentEncoder, HttpMessageDecoder, HttpRequestDecoder, HttpResponseDecoder, IdleStateHandler, JdkZlibEncoder, LengthFieldBasedFrameDecoder, MarshallingDecoder, ObjectDecoder, ProtobufVarint32FrameDecoder, ReadTimeoutHandler, ReplayingDecoder, RtspMessageDecoder, RtspRequestDecoder, RtspResponseDecoder, SpdyFrameDecoder, SslHandler, WebSocket00FrameDecoder, WebSocket08FrameDecoder, WebSocket13FrameDecoder, WebSocketFrameDecoder, ZlibEncoder

      public interface LifeCycleAwareChannelHandler
      extends ChannelHandler

  A `ChannelHandler` that is notified when it is added to or removed from a `ChannelPipeline`.

  ### Invalid access to the `ChannelHandlerContext`

  Calling `ChannelHandlerContext.sendUpstream(ChannelEvent)` or `ChannelHandlerContext.sendDownstream(ChannelEvent)` in `beforeAdd(ChannelHandlerContext)` or `afterRemove(ChannelHandlerContext)` might lead to an unexpected behavior. It is because the context object might not have been fully added to the pipeline or the context object is not a part of the pipeline anymore respectively.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler

      `ChannelHandler.Sharable`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterAdd(ChannelHandlerContext ctx)`
    `void` | `afterRemove(ChannelHandlerContext ctx)`
    `void` | `beforeAdd(ChannelHandlerContext ctx)`
    `void` | `beforeRemove(ChannelHandlerContext ctx)`

- - ### Method Detail

    - #### beforeAdd

          void beforeAdd(ChannelHandlerContext ctx)
                         throws Exception

      Throws:
        `Exception`

    - #### afterAdd

          void afterAdd(ChannelHandlerContext ctx)
                        throws Exception

      Throws:
        `Exception`

    - #### beforeRemove

          void beforeRemove(ChannelHandlerContext ctx)
                            throws Exception

      Throws:
        `Exception`

    - #### afterRemove

          void afterRemove(ChannelHandlerContext ctx)
                           throws Exception

      Throws:
        `Exception`

Copyright © 2008-2012 The Netty Project. All Rights Reserved.