Class SelectionKeyUtils

java.lang.Object
org.elasticsearch.nio.SelectionKeyUtils

public final class SelectionKeyUtils extends Object
  • Method Details

    • setWriteInterested

      public static void setWriteInterested(SelectionKey selectionKey) throws CancelledKeyException
      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

      public static void removeWriteInterested(SelectionKey selectionKey) throws CancelledKeyException
      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

      public static void removeConnectInterested(SelectionKey selectionKey) throws CancelledKeyException
      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

      public static void setAcceptInterested(SelectionKey selectionKey) throws CancelledKeyException
      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

      public static boolean isWriteInterested(SelectionKey selectionKey) throws CancelledKeyException
      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