org.apache.mina.core.service

## Interface IoProcessor<S extends IoSession>

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

      public interface IoProcessor<S extends IoSession>

  An internal interface to represent an 'I/O processor' that performs actual I/O operations for `IoSession`s. It abstracts existing reactor frameworks such as Java NIO once again to simplify transport implementations.
  Author:
    Apache MINA Project

- - ### Method Summary

    Methods
    Modifier and Type | Method and 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()` Returns `true` if and if only all resources of this processor have been disposed.
    `boolean` | `isDisposing()` Returns `true` if and if only `dispose()` method has been called.
    `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

    - #### updateTrafficControl

          void updateTrafficControl(S session)

      Controls the traffic of the specified `session` depending of the `IoSession.isReadSuspended()` and `IoSession.isWriteSuspended()` flags

    - #### 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.

Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.