public class SelectorThread
extends java.lang.Thread
| Constructor and Description |
|---|
SelectorThread(SelectorThreadPool pool,
SelectorThreadImpl impl,
boolean isPermanent,
int maximumNumOfChannels,
int id,
int idleServicePeriod,
int inactivePeriodsPerIdleEvent,
java.nio.channels.spi.SelectorProvider selectorProvider)
Construct a new selector thread.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSelectorOperation(java.lang.Runnable r)
Add an operation to the selector.
|
void |
cancelKey(java.nio.channels.SelectionKey key) |
void |
closeAllChannels() |
void |
flagShutdown()
Shutdown the thread.
|
int |
getMaximumLoad()
Get the maximum number of channels that this thread can service.
|
int |
getSelectorId()
Get the id of this selector thread.
|
int |
getThreadLoad()
Get the current thread load.
|
boolean |
isPermanent()
Is this a permanent thread?
|
boolean |
register(java.nio.channels.SelectableChannel sc,
int ops,
java.lang.Object attachment,
boolean wakeUp)
Register a channel with the selector.
|
void |
run()
The threads main.
|
void |
shutdown() |
void |
wakeup()
Wakeup the selector.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic SelectorThread(SelectorThreadPool pool, SelectorThreadImpl impl, boolean isPermanent, int maximumNumOfChannels, int id, int idleServicePeriod, int inactivePeriodsPerIdleEvent, java.nio.channels.spi.SelectorProvider selectorProvider) throws java.io.IOException
pool - SelectorThreadPoolimpl - SelectorThreadImplisPermanent - booleanmaximumNumOfChannels - intid - intidleServicePeriod - intinactivePeriodsPerIdleEvent - intselectorProvider - SelectorProviderjava.io.IOExceptionpublic boolean register(java.nio.channels.SelectableChannel sc,
int ops,
java.lang.Object attachment,
boolean wakeUp)
throws java.nio.channels.ClosedChannelException
sc - SelectableChannelops - intattachment - ObjectwakeUp - booleanjava.nio.channels.ClosedChannelExceptionpublic void closeAllChannels()
public void addSelectorOperation(java.lang.Runnable r)
r - Runnablepublic void wakeup()
public int getThreadLoad()
public boolean isPermanent()
public void flagShutdown()
public void shutdown()
public int getSelectorId()
public int getMaximumLoad()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void cancelKey(java.nio.channels.SelectionKey key)
Copyright © 2021. All rights reserved.