org.apache.mina.core.future

## Interface IoFuture

- All Known Subinterfaces:
    CloseFuture, ConnectFuture, ReadFuture, WriteFuture
  All Known Implementing Classes:
    AbstractIoAcceptor.AcceptorOperationFuture, AbstractIoService.ServiceOperationFuture, AbstractPollingIoConnector.ConnectionRequest, CompositeIoFuture, DefaultCloseFuture, DefaultConnectFuture, DefaultIoFuture, DefaultReadFuture, DefaultWriteFuture

      public interface IoFuture

  Represents the completion of an asynchronous I/O operation on an `IoSession`. Can be listened for completion using a `IoFutureListener`.
  Author:
    Apache MINA Project

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IoFuture` | `addListener(IoFutureListener<?> listener)` Adds an event `listener` which is notified when this future is completed.
    `IoFuture` | `await()` Wait for the asynchronous operation to complete.
    `boolean` | `await(long timeoutMillis)` Wait for the asynchronous operation to complete with the specified timeout.
    `boolean` | `await(long timeout, TimeUnit unit)` Wait for the asynchronous operation to complete with the specified timeout.
    `IoFuture` | `awaitUninterruptibly()` Wait for the asynchronous operation to complete uninterruptibly.
    `boolean` | `awaitUninterruptibly(long timeoutMillis)` Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
    `boolean` | `awaitUninterruptibly(long timeout, TimeUnit unit)` Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
    `IoSession` | `getSession()` Returns the `IoSession` which is associated with this future.
    `boolean` | `isDone()` Returns if the asynchronous operation is completed.
    `void` | `join()` Deprecated. Replaced with `awaitUninterruptibly()`.
    `boolean` | `join(long timeoutMillis)` Deprecated. Replaced with `awaitUninterruptibly(long)`.
    `IoFuture` | `removeListener(IoFutureListener<?> listener)` Removes an existing event `listener` so it won't be notified when the future is completed.

- - ### Method Detail

    - #### getSession

          IoSession getSession()

      Returns the `IoSession` which is associated with this future.

    - #### await

          IoFuture await()
                         throws InterruptedException

      Wait for the asynchronous operation to complete. The attached listeners will be notified when the operation is completed.
      Throws:
        `InterruptedException`

    - #### await

          boolean await(long timeout,
                      TimeUnit unit)
                        throws InterruptedException

      Wait for the asynchronous operation to complete with the specified timeout.
      Returns:
        `true` if the operation is completed.
      Throws:
        `InterruptedException`

    - #### await

          boolean await(long timeoutMillis)
                        throws InterruptedException

      Wait for the asynchronous operation to complete with the specified timeout.
      Returns:
        `true` if the operation is completed.
      Throws:
        `InterruptedException`

    - #### awaitUninterruptibly

          IoFuture awaitUninterruptibly()

      Wait for the asynchronous operation to complete uninterruptibly. The attached listeners will be notified when the operation is completed.
      Returns:
        the current IoFuture

    - #### awaitUninterruptibly

          boolean awaitUninterruptibly(long timeout,
                                     TimeUnit unit)

      Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
      Returns:
        `true` if the operation is completed.

    - #### awaitUninterruptibly

          boolean awaitUninterruptibly(long timeoutMillis)

      Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
      Returns:
        `true` if the operation is finished.

    - #### join

          @Deprecated
          void join()

      Deprecated. Replaced with `awaitUninterruptibly()`.

    - #### join

          @Deprecated
          boolean join(long timeoutMillis)

      Deprecated. Replaced with `awaitUninterruptibly(long)`.

    - #### isDone

          boolean isDone()

      Returns if the asynchronous operation is completed.

    - #### addListener

          IoFuture addListener(IoFutureListener<?> listener)

      Adds an event `listener` which is notified when this future is completed. If the listener is added after the completion, the listener is directly notified.

    - #### removeListener

          IoFuture removeListener(IoFutureListener<?> listener)

      Removes an existing event `listener` so it won't be notified when the future is completed.

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