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 aWorkerPool
should be used if you plan to share aWorkerPool
between 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 void
destroy()
Destroy theShareableWorkerPool
and release all resources.E
nextWorker()
Return the nextWorker
to usevoid
rebuildSelectors()
void
shutdown()
Shutdown theNioSelectorPool
and all internal created resources
-
-
-
Constructor Detail
-
ShareableWorkerPool
public ShareableWorkerPool(WorkerPool<E> wrapped)
-
-
Method Detail
-
nextWorker
public E nextWorker()
Description copied from interface:WorkerPool
Return the nextWorker
to use- Specified by:
nextWorker
in interfaceWorkerPool<E extends Worker>
- Returns:
- worker
-
rebuildSelectors
public void rebuildSelectors()
Description copied from interface:NioSelectorPool
Replaces the currentSelector
s of theBoss
es with newSelector
s to work around the infamous epoll 100% CPU bug.- Specified by:
rebuildSelectors
in interfaceNioSelectorPool
-
destroy
public void destroy()
Destroy theShareableWorkerPool
and release all resources. After this is called its not usable anymore
-
shutdown
public void shutdown()
Description copied from interface:NioSelectorPool
Shutdown theNioSelectorPool
and all internal created resources- Specified by:
shutdown
in interfaceNioSelectorPool
-
-