Interface IoHandler

    • Method Detail

      • initialize

        default void initialize()
        Initialize this IoHandler.
      • prepareToDestroy

        default void prepareToDestroy()
        Prepare to destroy this IoHandler. This method will be called before destroy() and may be called multiple times.
      • destroy

        default void destroy()
        Destroy the IoHandler and free all its resources. Once destroyed using the IoHandler will cause undefined behaviour.
      • register

        IoRegistration register​(IoHandle handle)
                         throws java.lang.Exception
        Register a IoHandle for IO.
        Parameters:
        handle - the IoHandle to register.
        Throws:
        java.lang.Exception - thrown if an error happens during registration.
      • wakeup

        void wakeup()
        Wakeup the IoHandler, which means if any operation blocks it should be unblocked and return as soon as possible.
      • isCompatible

        boolean isCompatible​(java.lang.Class<? extends IoHandle> handleType)
        Returns true if the given type is compatible with this IoHandler and so can be registered, false otherwise.
        Parameters:
        handleType - the type of the IoHandle.
        Returns:
        if compatible of not.