Class NioIoHandler.DefaultNioRegistration

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.atomic.AtomicBoolean canceled  
      private NioIoHandle handle  
      private java.nio.channels.SelectionKey key  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T attachment()
      Implementation specific attachment, which might be null.
      boolean cancel()
      Cancel the registration.
      (package private) void close()  
      (package private) NioIoHandle handle()  
      (package private) void handle​(int ready)  
      boolean isValid()
      Returns true if the registration is still valid.
      (package private) void register​(java.nio.channels.Selector selector)  
      long submit​(IoOps ops)
      Submit the IoOps to the registration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • canceled

        private final java.util.concurrent.atomic.AtomicBoolean canceled
      • key

        private volatile java.nio.channels.SelectionKey key
    • Constructor Detail

      • DefaultNioRegistration

        DefaultNioRegistration​(ThreadAwareExecutor executor,
                               NioIoHandle handle,
                               NioIoOps initialOps,
                               java.nio.channels.Selector selector)
                        throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • register

        void register​(java.nio.channels.Selector selector)
               throws java.io.IOException
        Throws:
        java.io.IOException
      • attachment

        public <T> T attachment()
        Description copied from interface: IoRegistration
        Implementation specific attachment, which might be null.
        Specified by:
        attachment in interface IoRegistration
        Returns:
        attachment.
      • submit

        public long submit​(IoOps ops)
        Description copied from interface: IoRegistration
        Submit the IoOps to the registration.
        Specified by:
        submit in interface IoRegistration
        Parameters:
        ops - ops.
        Returns:
        an identifier for the operation, which might be unique or not (depending on the implementation).
      • cancel

        public boolean cancel()
        Description copied from interface: IoRegistration
        Cancel the registration.
        Specified by:
        cancel in interface IoRegistration
        Returns:
        true if cancellation was successful, false otherwise.
      • close

        void close()
      • handle

        void handle​(int ready)