Class AbstractSelectorThread
java.lang.Object
com.j_spaces.kernel.ManagedRunnable
com.gigaspaces.lrmi.nio.selector.handler.AbstractSelectorThread
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
AcceptSelectorThread,ClientHandler,ReadSelectorThread,WriteSelectorThread
Provides a general selector logic.
- Since:
- 6.0.4, 6.5
- Author:
- Guy Korland
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcancelKey(SelectionKey key) protected voidcloseChannel(SocketChannel channel) Close a given channelprotected abstract voidprotected Selectorprotected abstract voidprotected SelectionKeyregister(SocketChannel channel, int requestOps) voidrun()protected voidThis method will be invoked by requestShutdown().Methods inherited from class com.j_spaces.kernel.ManagedRunnable
requestShutdown, shouldShutdown
-
Field Details
-
_logger
protected static final org.slf4j.Logger _logger -
ownerThread
-
-
Constructor Details
-
AbstractSelectorThread
- Throws:
IOException
-
-
Method Details
-
run
public void run() -
register
protected SelectionKey register(SocketChannel channel, int requestOps) throws ClosedChannelException - Throws:
ClosedChannelException
-
enableSelectionKeys
protected abstract void enableSelectionKeys() -
handleConnection
- Throws:
IOExceptionInterruptedException
-
cancelKey
-
closeChannel
Close a given channel- Parameters:
channel- target channel to close.
-
waitWhileFinish
protected void waitWhileFinish()Description copied from class:ManagedRunnableThis method will be invoked by requestShutdown(). Request method will be block while waitWhileFinish() will not be finished.- Specified by:
waitWhileFinishin classManagedRunnable
-
getSelector
-