Interface IoProcessor<S extends IoSession>

Type Parameters:
S - the type of the IoSession this processor can handle
All Known Implementing Classes:
AbstractPollingIoProcessor, AprIoProcessor, NioDatagramAcceptor, NioProcessor, SimpleIoProcessorPool, VmPipeFilterChain.VmPipeIoProcessor

public interface IoProcessor<S extends IoSession>
An internal interface to represent an 'I/O processor' that performs actual I/O operations for IoSessions. It abstracts existing reactor frameworks such as Java NIO once again to simplify transport implementations.
  • Method Summary

    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
    Releases any resources allocated by this processor.
    void
    flush(S session)
    Flushes the internal write request queue of the specified session.
    boolean
     
    boolean
     
    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
    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 Details

    • 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
    • updateTrafficControl

      void updateTrafficControl(S session)
      Controls the traffic of the specified session depending of the IoSession.isReadSuspended() and IoSession.isWriteSuspended() flags
      Parameters:
      session - The session to be updated
    • 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