Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
SelectorThread(SelectorThreadPool pool,
SelectorThreadImpl impl,
boolean isPermanent,
int maximumNumOfChannels,
int id,
int idleServicePeriod,
int inactivePeriodsPerIdleEvent,
SelectorProvider selectorProvider)
Construct a new selector thread.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectorOperation(Runnable r)
Add an operation to the selector.
|
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 |
isRunning() |
boolean |
register(SelectableChannel sc,
int ops,
Object attachment,
boolean wakeUp)
Register a channel with the selector.
|
void |
run()
The threads main.
|
void |
shutdown() |
void |
start() |
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, stop, stop, suspend, toString, yield
public SelectorThread(SelectorThreadPool pool, SelectorThreadImpl impl, boolean isPermanent, int maximumNumOfChannels, int id, int idleServicePeriod, int inactivePeriodsPerIdleEvent, SelectorProvider selectorProvider) throws IOException
pool
- SelectorThreadPoolimpl
- SelectorThreadImplisPermanent
- booleanmaximumNumOfChannels
- intid
- intidleServicePeriod
- intinactivePeriodsPerIdleEvent
- intselectorProvider
- SelectorProviderIOException
public boolean register(SelectableChannel sc, int ops, Object attachment, boolean wakeUp) throws ClosedChannelException
sc
- SelectableChannelops
- intattachment
- ObjectwakeUp
- booleanClosedChannelException
public void closeAllChannels()
public void addSelectorOperation(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()
public boolean isRunning()
Copyright © 2024. All rights reserved.