public abstract class AbstractSelectorThread extends ManagedRunnable implements Runnable
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
_logger |
protected Thread |
ownerThread |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSelectorThread() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cancelKey(SelectionKey key) |
protected void |
closeChannel(SocketChannel channel)
Close a given channel
|
protected abstract void |
enableSelectionKeys() |
protected Selector |
getSelector() |
protected abstract void |
handleConnection(SelectionKey key) |
protected SelectionKey |
register(SocketChannel channel,
int requestOps) |
void |
run() |
protected void |
waitWhileFinish()
This method will be invoked by requestShutdown().
|
requestShutdown, shouldShutdownprotected static final org.slf4j.Logger _logger
protected volatile Thread ownerThread
protected AbstractSelectorThread()
throws IOException
IOExceptionprotected SelectionKey register(SocketChannel channel, int requestOps) throws ClosedChannelException
ClosedChannelExceptionprotected abstract void enableSelectionKeys()
protected abstract void handleConnection(SelectionKey key) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void cancelKey(SelectionKey key)
protected void closeChannel(SocketChannel channel)
channel - target channel to close.protected void waitWhileFinish()
ManagedRunnablewaitWhileFinish in class ManagedRunnableprotected Selector getSelector()
Copyright © GigaSpaces.