Package org.elasticsearch.nio
Class SelectionKeyUtils
java.lang.Object
org.elasticsearch.nio.SelectionKeyUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisWriteInterested(SelectionKey selectionKey) Checks for an interest in writes for this selection key.static voidremoveConnectInterested(SelectionKey selectionKey) Removes an interest in connects for this selection key while maintaining other interests.static voidremoveWriteInterested(SelectionKey selectionKey) Removes an interest in writes for this selection key while maintaining other interests.static voidsetAcceptInterested(SelectionKey selectionKey) Adds an interest in accepts for this selection key while maintaining other interests.static voidsetConnectAndReadInterested(SelectionKey selectionKey) Removes an interest in connects and reads for this selection key while maintaining other interests.static voidsetConnectReadAndWriteInterested(SelectionKey selectionKey) Removes an interest in connects, reads, and writes for this selection key while maintaining other interests.static voidsetWriteInterested(SelectionKey selectionKey) Adds an interest in writes for this selection key while maintaining other interests.
-
Method Details
-
setWriteInterested
Adds an interest in writes for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
CancelledKeyException- if the key was already cancelled
-
removeWriteInterested
Removes an interest in writes for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
CancelledKeyException- if the key was already cancelled
-
setConnectAndReadInterested
public static void setConnectAndReadInterested(SelectionKey selectionKey) throws CancelledKeyException Removes an interest in connects and reads for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
CancelledKeyException- if the key was already cancelled
-
setConnectReadAndWriteInterested
public static void setConnectReadAndWriteInterested(SelectionKey selectionKey) throws CancelledKeyException Removes an interest in connects, reads, and writes for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
CancelledKeyException- if the key was already cancelled
-
removeConnectInterested
Removes an interest in connects for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
CancelledKeyException- if the key was already cancelled
-
setAcceptInterested
Adds an interest in accepts for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
CancelledKeyException- if the key was already cancelled
-
isWriteInterested
Checks for an interest in writes for this selection key.- Parameters:
selectionKey- the selection key- Returns:
- a boolean indicating if we are currently interested in writes for this channel
- Throws:
CancelledKeyException- if the key was already cancelled
-