Interface IoProcessor<S extends IoSession>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void add​(S session)
      Adds the specified session to the I/O processor so that the I/O processor starts to perform any I/O operations related with the session.
      void dispose()
      Releases any resources allocated by this processor.
      void flush​(S session)
      Flushes the internal write request queue of the specified session.
      boolean isDisposed()  
      boolean isDisposing()  
      void remove​(S session)
      Removes and closes the specified session from the I/O processor so that the I/O processor closes the connection associated with the session and releases any other related resources.
      void updateTrafficControl​(S session)
      Controls the traffic of the specified session depending of the IoSession.isReadSuspended() and IoSession.isWriteSuspended() flags
      void write​(S session, WriteRequest writeRequest)
      Writes the WriteRequest for the specified session.
    • Method Detail

      • isDisposing

        boolean isDisposing()
        Returns:
        true if and if only dispose() method has been called. Please note that this method will return true even after all the related resources are released.
      • isDisposed

        boolean isDisposed()
        Returns:
        true if and if only all resources of this processor have been disposed.
      • dispose

        void dispose()
        Releases any resources allocated by this processor. Please note that the resources might not be released as long as there are any sessions managed by this processor. Most implementations will close all sessions immediately and release the related resources.
      • add

        void add​(S session)
        Adds the specified session to the I/O processor so that the I/O processor starts to perform any I/O operations related with the session.
        Parameters:
        session - The added session
      • flush

        void flush​(S session)
        Flushes the internal write request queue of the specified session.
        Parameters:
        session - The session we want the message to be written
      • write

        void write​(S session,
                   WriteRequest writeRequest)
        Writes the WriteRequest for the specified session.
        Parameters:
        session - The session we want the message to be written
        writeRequest - the WriteRequest to write
      • remove

        void remove​(S session)
        Removes and closes the specified session from the I/O processor so that the I/O processor closes the connection associated with the session and releases any other related resources.
        Parameters:
        session - The session to be removed