org.jboss.netty.handler.execution

## Class ChainedExecutor

- java.lang.Object
- - org.jboss.netty.handler.execution.ChainedExecutor

- All Implemented Interfaces:
    Executor, ExternalResourceReleasable

      public class ChainedExecutor
      extends Object
      implements Executor, ExternalResourceReleasable

  A special `Executor` which allows to chain a series of `Executor`s and `ChannelEventRunnableFilter`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChainedExecutor(ChannelEventRunnableFilter filter, Executor cur, Executor next)` Create a new `ChainedExecutor` which will used the given `ChannelEventRunnableFilter` to see if the `cur` `Executor` should get used.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `execute(Runnable command)` Execute the passed `ChannelEventRunnable` with the current `Executor` if the `ChannelEventRunnableFilter` match.
    `void` | `releaseExternalResources()` Releases the external resources that this object depends on.

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

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

- - ### Constructor Detail

    - #### ChainedExecutor

          public ChainedExecutor(ChannelEventRunnableFilter filter,
                         Executor cur,
                         Executor next)

      Create a new `ChainedExecutor` which will used the given `ChannelEventRunnableFilter` to see if the `cur` `Executor` should get used. Otherwise it will pass the work to the `next` `Executor`
      Parameters:
        `filter` - the `ChannelEventRunnableFilter` which will be used to check if the `ChannelEventRunnable` should be passed to the cur or next `Executor`
        `cur` - the `Executor` to use if the `ChannelEventRunnableFilter` match
        `next` - the `Executor` to use if the `ChannelEventRunnableFilter` does not match

  - ### Method Detail

    - #### execute

          public void execute(Runnable command)

      Execute the passed `ChannelEventRunnable` with the current `Executor` if the `ChannelEventRunnableFilter` match. Otherwise pass it to the next `Executor` in the chain.
      Specified by:
        `execute` in interface `Executor`

    - #### releaseExternalResources

          public void releaseExternalResources()

      Description copied from interface: `ExternalResourceReleasable`
      Releases the external resources that this object depends on. You should not call this method if the external resources (e.g. thread pool) are in use by other objects.
      Specified by:
        `releaseExternalResources` in interface `ExternalResourceReleasable`

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