public abstract class AbstractSelectorThread extends ManagedRunnable implements Runnable
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
_logger |
protected Pivot |
_pivot |
protected Thread |
ownerThread |
Modifier | Constructor and Description |
---|---|
protected |
AbstractSelectorThread(Pivot pivot) |
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, shouldShutdown
protected static final org.slf4j.Logger _logger
protected final Pivot _pivot
protected volatile Thread ownerThread
protected AbstractSelectorThread(Pivot pivot) throws IOException
IOException
protected SelectionKey register(SocketChannel channel, int requestOps) throws ClosedChannelException
ClosedChannelException
protected abstract void enableSelectionKeys()
protected abstract void handleConnection(SelectionKey key) throws IOException, InterruptedException
IOException
InterruptedException
protected void cancelKey(SelectionKey key)
protected void closeChannel(SocketChannel channel)
channel
- target channel to close.protected void waitWhileFinish()
ManagedRunnable
waitWhileFinish
in class ManagedRunnable
protected Selector getSelector()
Copyright © GigaSpaces.