Package org.elasticsearch.nio
Class SelectionKeyUtils
- java.lang.Object
-
- org.elasticsearch.nio.SelectionKeyUtils
-
public final class SelectionKeyUtils extends java.lang.Object
-
-
Method Summary
Modifier and Type Method Description static booleanisWriteInterested(java.nio.channels.SelectionKey selectionKey)Checks for an interest in writes for this selection key.static voidremoveConnectInterested(java.nio.channels.SelectionKey selectionKey)Removes an interest in connects for this selection key while maintaining other interests.static voidremoveWriteInterested(java.nio.channels.SelectionKey selectionKey)Removes an interest in writes for this selection key while maintaining other interests.static voidsetAcceptInterested(java.nio.channels.SelectionKey selectionKey)Adds an interest in accepts for this selection key while maintaining other interests.static voidsetConnectAndReadInterested(java.nio.channels.SelectionKey selectionKey)Removes an interest in connects and reads for this selection key while maintaining other interests.static voidsetConnectReadAndWriteInterested(java.nio.channels.SelectionKey selectionKey)Removes an interest in connects, reads, and writes for this selection key while maintaining other interests.static voidsetWriteInterested(java.nio.channels.SelectionKey selectionKey)Adds an interest in writes for this selection key while maintaining other interests.
-
-
-
Method Detail
-
setWriteInterested
public static void setWriteInterested(java.nio.channels.SelectionKey selectionKey) throws java.nio.channels.CancelledKeyExceptionAdds an interest in writes for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
java.nio.channels.CancelledKeyException- if the key was already cancelled
-
removeWriteInterested
public static void removeWriteInterested(java.nio.channels.SelectionKey selectionKey) throws java.nio.channels.CancelledKeyExceptionRemoves an interest in writes for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
java.nio.channels.CancelledKeyException- if the key was already cancelled
-
setConnectAndReadInterested
public static void setConnectAndReadInterested(java.nio.channels.SelectionKey selectionKey) throws java.nio.channels.CancelledKeyExceptionRemoves an interest in connects and reads for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
java.nio.channels.CancelledKeyException- if the key was already cancelled
-
setConnectReadAndWriteInterested
public static void setConnectReadAndWriteInterested(java.nio.channels.SelectionKey selectionKey) throws java.nio.channels.CancelledKeyExceptionRemoves an interest in connects, reads, and writes for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
java.nio.channels.CancelledKeyException- if the key was already cancelled
-
removeConnectInterested
public static void removeConnectInterested(java.nio.channels.SelectionKey selectionKey) throws java.nio.channels.CancelledKeyExceptionRemoves an interest in connects for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
java.nio.channels.CancelledKeyException- if the key was already cancelled
-
setAcceptInterested
public static void setAcceptInterested(java.nio.channels.SelectionKey selectionKey) throws java.nio.channels.CancelledKeyExceptionAdds an interest in accepts for this selection key while maintaining other interests.- Parameters:
selectionKey- the selection key- Throws:
java.nio.channels.CancelledKeyException- if the key was already cancelled
-
isWriteInterested
public static boolean isWriteInterested(java.nio.channels.SelectionKey selectionKey) throws java.nio.channels.CancelledKeyExceptionChecks 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:
java.nio.channels.CancelledKeyException- if the key was already cancelled
-
-