public class NonBlockingIOThread extends Thread implements OperationHostileThread
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
NonBlockingIOThread(ThreadGroup threadGroup,
String threadName,
ILogger logger,
NonBlockingIOThreadOutOfMemoryHandler oomeHandler) |
NonBlockingIOThread(ThreadGroup threadGroup,
String threadName,
ILogger logger,
NonBlockingIOThreadOutOfMemoryHandler oomeHandler,
boolean selectNow) |
NonBlockingIOThread(ThreadGroup threadGroup,
String threadName,
ILogger logger,
NonBlockingIOThreadOutOfMemoryHandler oomeHandler,
boolean selectNow,
Selector selector) |
Modifier and Type | Method and Description |
---|---|
void |
addTask(Runnable task)
Adds a task to this NonBlockingIOThread without notifying the thread.
|
void |
addTaskAndWakeup(Runnable task)
Adds a task to be executed by the NonBlockingIOThread and wakes up the selector so that it will
eventually pick up the task.
|
long |
getEventCount()
Returns the total number of selection-key events that have been processed by this thread.
|
Selector |
getSelector()
Gets the Selector
|
protected void |
handleSelectionKey(SelectionKey sk) |
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 NonBlockingIOThread(ThreadGroup threadGroup, String threadName, ILogger logger, NonBlockingIOThreadOutOfMemoryHandler oomeHandler)
public NonBlockingIOThread(ThreadGroup threadGroup, String threadName, ILogger logger, NonBlockingIOThreadOutOfMemoryHandler oomeHandler, boolean selectNow)
public NonBlockingIOThread(ThreadGroup threadGroup, String threadName, ILogger logger, NonBlockingIOThreadOutOfMemoryHandler oomeHandler, boolean selectNow, Selector selector)
public final Selector getSelector()
public long getEventCount()
public final 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 nullprotected void handleSelectionKey(SelectionKey sk)
public final void shutdown()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.