public class SelectorThreadPool
extends java.lang.Object
SelectoThreads increasing the pool when required
and always maintaining the minimum number of permanent threads required.| Constructor and Description |
|---|
SelectorThreadPool(SelectorThreadImpl impl,
int permanentThreads,
int maximumChannels,
int idleServicePeriod,
int inactivePeriodsPerIdleEvent,
java.nio.channels.spi.SelectorProvider selectorProvider)
Construct a thread pool.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeAllChannels() |
int |
getCurrentLoad() |
void |
register(java.nio.channels.ServerSocketChannel socketChannel,
int ops,
ClientAcceptor acceptor,
boolean wakeup) |
SelectorThread |
selectNextThread()
Select the next available thread with the minimum load.
|
void |
shutdown()
Shutdown all threads in the pool.
|
public SelectorThreadPool(SelectorThreadImpl impl, int permanentThreads, int maximumChannels, int idleServicePeriod, int inactivePeriodsPerIdleEvent, java.nio.channels.spi.SelectorProvider selectorProvider) throws java.io.IOException
impl - SelectorThreadImplpermanentThreads - intmaximumChannels - intidleServicePeriod - intinactivePeriodsPerIdleEvent - intselectorProvider - SelectorProviderjava.io.IOExceptionpublic void closeAllChannels()
public void shutdown()
public int getCurrentLoad()
public SelectorThread selectNextThread() throws java.io.IOException
java.io.IOExceptionpublic void register(java.nio.channels.ServerSocketChannel socketChannel,
int ops,
ClientAcceptor acceptor,
boolean wakeup)
throws java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelExceptionCopyright © 2021. All rights reserved.