org.jboss.netty.channel

## Class AbstractChannelSink

- java.lang.Object
- - org.jboss.netty.channel.AbstractChannelSink

- All Implemented Interfaces:
    ChannelSink
  Direct Known Subclasses:
    AbstractNioChannelSink, AbstractOioChannelSink

      public abstract class AbstractChannelSink
      extends Object
      implements ChannelSink

  A skeletal `ChannelSink` implementation.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractChannelSink()` Creates a new instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `exceptionCaught(ChannelPipeline pipeline, ChannelEvent event, ChannelPipelineException cause)` Sends an `ExceptionEvent` upstream with the specified `cause`.
    `ChannelFuture` | `execute(ChannelPipeline pipeline, Runnable task)` This implementation just directly call `Runnable.run()`.
    `protected boolean` | `isFireExceptionCaughtLater(ChannelEvent event, Throwable actualCause)` Returns `true` if and only if the specified `actualCause`, which was raised while handling the specified `event`, must trigger an `exceptionCaught()` event in an I/O thread.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.jboss.netty.channel.ChannelSink

      `eventSunk`

- - ### Constructor Detail

    - #### AbstractChannelSink

          protected AbstractChannelSink()

      Creates a new instance.

  - ### Method Detail

    - #### exceptionCaught

          public void exceptionCaught(ChannelPipeline pipeline,
                             ChannelEvent event,
                             ChannelPipelineException cause)
                               throws Exception

      Sends an `ExceptionEvent` upstream with the specified `cause`.
      Specified by:
        `exceptionCaught` in interface `ChannelSink`
      Parameters:
        `event` - the `ChannelEvent` which caused a `ChannelHandler` to raise an exception
        `cause` - the exception raised by a `ChannelHandler`
      Throws:
        `Exception`

    - #### isFireExceptionCaughtLater

          protected boolean isFireExceptionCaughtLater(ChannelEvent event,
                                           Throwable actualCause)

      Returns `true` if and only if the specified `actualCause`, which was raised while handling the specified `event`, must trigger an `exceptionCaught()` event in an I/O thread.
      Parameters:
        `event` - the event which raised exception
        `actualCause` - the raised exception

    - #### execute

          public ChannelFuture execute(ChannelPipeline pipeline,
                              Runnable task)

      This implementation just directly call `Runnable.run()`. Sub-classes should override this if they can handle it in a better way
      Specified by:
        `execute` in interface `ChannelSink`

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