protected abstract class TDisruptorServer.AbstractSelectorThread extends Thread implements Closeable
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected Selector |
selector |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
AbstractSelectorThread(String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanupSelectionKey(SelectionKey key) |
void |
close() |
boolean |
isStopped() |
protected abstract void |
processKey(SelectionKey key)
Process each individual key that reported ready state
|
void |
run() |
protected abstract void |
selectorIterationComplete()
Called after each selector event loop completion, useful for booking (e.g.
|
void |
wakeupSelector() |
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, yield
protected final Selector selector
public AbstractSelectorThread(String name) throws IOException
IOException
public boolean isStopped()
protected abstract void processKey(SelectionKey key) throws IOException
key
- The key to processIOException
- any I/O related errorprotected abstract void selectorIterationComplete() throws IOException
IOException
- any I/O related errorprotected void cleanupSelectionKey(SelectionKey key)
public void wakeupSelector()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2013–2017. All rights reserved.