Package org.glassfish.grizzly.nio
Interface SelectionKeyHandler
-
- All Known Implementing Classes:
DefaultSelectionKeyHandler
public interface SelectionKeyHandlerSelectionKeyHandlerimplementations are responsible for handlingSelectionKeylife cycle events.- Author:
- Alexey Stashok
-
-
Field Summary
Fields Modifier and Type Field Description static SelectionKeyHandlerDEFAULT_SELECTION_KEY_HANDLERThe defaultSelectionKeyHandlerused by all created builder instances.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel(java.nio.channels.SelectionKey key)NIOConnectiongetConnectionForKey(java.nio.channels.SelectionKey selectionKey)IOEvent[]getIOEvents(int interest)intioEvent2SelectionKeyInterest(IOEvent ioEvent)voidonKeyDeregistered(java.nio.channels.SelectionKey key)voidonKeyRegistered(java.nio.channels.SelectionKey key)booleanonProcessInterest(java.nio.channels.SelectionKey key, int interest)IOEventselectionKeyInterest2IoEvent(int selectionKeyInterest)voidsetConnectionForKey(NIOConnection connection, java.nio.channels.SelectionKey selectionKey)
-
-
-
Field Detail
-
DEFAULT_SELECTION_KEY_HANDLER
static final SelectionKeyHandler DEFAULT_SELECTION_KEY_HANDLER
The default
SelectionKeyHandlerused by all created builder instances.The default may be changed by setting the system property
org.glassfish.grizzly.DEFAULT_SELECTION_KEY_HANDLERwith the fully qualified name of the class that implements the SelectionKeyHandler interface. Note that this class must be public and have a public no-arg constructor.
-
-
Method Detail
-
onKeyRegistered
void onKeyRegistered(java.nio.channels.SelectionKey key)
-
onKeyDeregistered
void onKeyDeregistered(java.nio.channels.SelectionKey key)
-
onProcessInterest
boolean onProcessInterest(java.nio.channels.SelectionKey key, int interest) throws java.io.IOException- Throws:
java.io.IOException
-
cancel
void cancel(java.nio.channels.SelectionKey key) throws java.io.IOException- Throws:
java.io.IOException
-
getConnectionForKey
NIOConnection getConnectionForKey(java.nio.channels.SelectionKey selectionKey)
-
setConnectionForKey
void setConnectionForKey(NIOConnection connection, java.nio.channels.SelectionKey selectionKey)
-
ioEvent2SelectionKeyInterest
int ioEvent2SelectionKeyInterest(IOEvent ioEvent)
-
selectionKeyInterest2IoEvent
IOEvent selectionKeyInterest2IoEvent(int selectionKeyInterest)
-
getIOEvents
IOEvent[] getIOEvents(int interest)
-
-