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:
NioSelectorPool,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 forWorkerPoolimplementations that create theWorker's up-front and return them in a "fair" fashion when callingnextWorker()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidinit()protected abstract EnewWorker(Executor executor)EnextWorker()Return the nextWorkerto usevoidrebuildSelectors()voidreleaseExternalResources()Releases the external resources that this object depends on.voidshutdown()Shutdown theNioSelectorPooland all internal created resources
-
-
-
Method Detail
-
init
protected void init()
-
nextWorker
public E nextWorker()
Description copied from interface:WorkerPoolReturn the nextWorkerto use- Specified by:
nextWorkerin interfaceWorkerPool<E extends org.jboss.netty.channel.socket.nio.AbstractNioWorker>- Returns:
- worker
-
rebuildSelectors
public void rebuildSelectors()
Description copied from interface:NioSelectorPoolReplaces the currentSelectors of theBosses with newSelectors to work around the infamous epoll 100% CPU bug.- Specified by:
rebuildSelectorsin interfaceNioSelectorPool
-
releaseExternalResources
public void releaseExternalResources()
Description copied from interface:ExternalResourceReleasableReleases 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:
releaseExternalResourcesin interfaceExternalResourceReleasable
-
shutdown
public void shutdown()
Description copied from interface:NioSelectorPoolShutdown theNioSelectorPooland all internal created resources- Specified by:
shutdownin interfaceNioSelectorPool
-
-