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 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.
-
-
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()voidshutdown()Shutdown theNioSelectorPooland all internal created resources
-
-
-
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
-
-