Class AbstractNioWorkerPool<E extends AbstractNioWorker>

java.lang.Object
org.jboss.netty.channel.socket.nio.AbstractNioWorkerPool<E>
All Implemented Interfaces:
NioSelectorPool, WorkerPool<E>, ExternalResourceReleasable
Direct Known Subclasses:
NioDatagramWorkerPool, NioWorkerPool

public abstract class AbstractNioWorkerPool<E extends 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()
  • Field Details

    • INITIALIZATION_TIMEOUT

      private static final int INITIALIZATION_TIMEOUT
      The worker pool raises an exception unless all worker threads start and run within this timeout (in seconds.)
      See Also:
    • logger

      private static final InternalLogger logger
    • workers

      private final AbstractNioWorker[] workers
    • workerIndex

      private final AtomicInteger workerIndex
    • workerExecutor

      private final Executor workerExecutor
    • initialized

      private final AtomicBoolean initialized
  • Constructor Details

    • AbstractNioWorkerPool

      AbstractNioWorkerPool(Executor workerExecutor, int workerCount)
      Create a new instance
      Parameters:
      workerExecutor - the Executor to use for the Worker's
      workerCount - the count of Worker's to create
    • AbstractNioWorkerPool

      AbstractNioWorkerPool(Executor workerExecutor, int workerCount, boolean autoInit)
  • Method Details