Class ShareableWorkerPool<E extends Worker>
- java.lang.Object
-
- org.jboss.netty.channel.socket.nio.ShareableWorkerPool<E>
-
- All Implemented Interfaces:
NioSelectorPool,WorkerPool<E>
public final class ShareableWorkerPool<E extends Worker> extends java.lang.Object implements WorkerPool<E>
This implementation of aWorkerPoolshould be used if you plan to share aWorkerPoolbetween different Factories. You will need to calldestroy()by your own once you want to release any resources of it.
-
-
Field Summary
Fields Modifier and Type Field Description private WorkerPool<E>wrapped
-
Constructor Summary
Constructors Constructor Description ShareableWorkerPool(WorkerPool<E> wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroy theShareableWorkerPooland release all resources.EnextWorker()Return the nextWorkerto usevoidrebuildSelectors()Replaces the currentSelectors of theBosses with newSelectors to work around the infamous epoll 100% CPU bug.voidshutdown()Shutdown theNioSelectorPooland all internal created resources
-
-
-
Field Detail
-
wrapped
private final WorkerPool<E extends Worker> wrapped
-
-
Constructor Detail
-
ShareableWorkerPool
public ShareableWorkerPool(WorkerPool<E> wrapped)
-
-
Method Detail
-
nextWorker
public E nextWorker()
Description copied from interface:WorkerPoolReturn the nextWorkerto use- Specified by:
nextWorkerin interfaceWorkerPool<E extends Worker>- 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
-
destroy
public void destroy()
Destroy theShareableWorkerPooland release all resources. After this is called its not usable anymore
-
shutdown
public void shutdown()
Description copied from interface:NioSelectorPoolShutdown theNioSelectorPooland all internal created resources- Specified by:
shutdownin interfaceNioSelectorPool
-
-