org.jboss.netty.channel.socket.nio

## Class AbstractNioWorkerPool<E extends org.jboss.netty.channel.socket.nio.AbstractNioWorker>

- java.lang.Object
- - org.jboss.netty.channel.socket.nio.AbstractNioWorkerPool<E>

- All Implemented Interfaces:
    WorkerPool<E>, ExternalResourceReleasable
  Direct Known Subclasses:
    NioDatagramWorkerPool, NioWorkerPool

      public abstract class AbstractNioWorkerPool<E extends org.jboss.netty.channel.socket.nio.AbstractNioWorker>
      extends Object
      implements WorkerPool<E>, ExternalResourceReleasable

  Abstract base class for `WorkerPool` implementations that create the `Worker`'s up-front and return them in a "fair" fashion when calling `nextWorker()`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected E` | `createWorker(Executor executor)` Create a new `Worker` which uses the given `Executor` to service IO
    `protected abstract E` | `createWorker(Executor executor, boolean allowShutdownOnIdle)` Deprecated. use `createWorker(Executor)`
    `E` | `nextWorker()` Return the next `Worker` to use
    `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`

- - ### Method Detail

    - #### createWorker

          @Deprecated
          protected abstract E createWorker(Executor executor,
                                  boolean allowShutdownOnIdle)

      Deprecated. use `createWorker(Executor)`
      Create a new `Worker` which uses the given `Executor` to service IO
      Parameters:
        `executor` - the `Executor` to use
        `allowShutdownOnIdle` - allow the `Worker` to shutdown when there is not `Channel` is registered with it
      Returns:
        worker the new `Worker`

    - #### createWorker

          protected E createWorker(Executor executor)

      Create a new `Worker` which uses the given `Executor` to service IO
      Parameters:
        `executor` - the `Executor` to use
      Returns:
        worker the new `Worker`

    - #### nextWorker

          public E nextWorker()

      Description copied from interface: `WorkerPool`
      Return the next `Worker` to use
      Specified by:
        `nextWorker` in interface `WorkerPool<E extends org.jboss.netty.channel.socket.nio.AbstractNioWorker>`
      Returns:
        worker

    - #### 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.