public class NioThread extends Thread implements OperationHostileThread
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
int |
id |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
NioThread(String threadName,
ILogger logger,
ChannelErrorHandler errorHandler) |
NioThread(String threadName,
ILogger logger,
ChannelErrorHandler errorHandler,
SelectorMode selectMode,
IdleStrategy idleStrategy) |
NioThread(String threadName,
ILogger logger,
ChannelErrorHandler errorHandler,
SelectorMode selectMode,
Selector selector,
IdleStrategy idleStrategy) |
Modifier and Type | Method and Description |
---|---|
void |
addTask(Runnable task)
Adds a task to this NioThread without notifying the thread.
|
void |
addTaskAndWakeup(Runnable task)
Adds a task to be executed by the NioThread and wakes up the selector so that it will
eventually pick up the task.
|
long |
bytesTransceived() |
long |
completedTaskCount() |
long |
eventCount() |
long |
framesTransceived() |
long |
getEventCount()
Returns the total number of selection-key events that have been processed by this thread.
|
Selector |
getSelector()
Gets the Selector
|
long |
handleCount() |
long |
priorityFramesTransceived() |
void |
run() |
void |
shutdown() |
String |
toString() |
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, yield
public NioThread(String threadName, ILogger logger, ChannelErrorHandler errorHandler)
public NioThread(String threadName, ILogger logger, ChannelErrorHandler errorHandler, SelectorMode selectMode, IdleStrategy idleStrategy)
public NioThread(String threadName, ILogger logger, ChannelErrorHandler errorHandler, SelectorMode selectMode, Selector selector, IdleStrategy idleStrategy)
public long bytesTransceived()
public long framesTransceived()
public long priorityFramesTransceived()
public long handleCount()
public long eventCount()
public long completedTaskCount()
public Selector getSelector()
public long getEventCount()
public void addTask(Runnable task)
task
- the task to addNullPointerException
- if task is nullpublic void addTaskAndWakeup(Runnable task)
task
- the task to add.NullPointerException
- if task is nullpublic void shutdown()
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.