org.apache.mina.core.future

## Class DefaultCloseFuture

- java.lang.Object
- - org.apache.mina.core.future.DefaultIoFuture
  - - org.apache.mina.core.future.DefaultCloseFuture

- All Implemented Interfaces:
    CloseFuture, IoFuture

      public class DefaultCloseFuture
      extends DefaultIoFuture
      implements CloseFuture

  A default implementation of `CloseFuture`.
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultCloseFuture(IoSession session)` Creates a new instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CloseFuture` | `addListener(IoFutureListener<?> listener)` Adds an event `listener` which is notified when this future is completed.
    `CloseFuture` | `await()` Wait for the asynchronous operation to complete.
    `CloseFuture` | `awaitUninterruptibly()` Wait for the asynchronous operation to complete uninterruptibly.
    `boolean` | `isClosed()` Returns `true` if the close request is finished and the session is closed.
    `CloseFuture` | `removeListener(IoFutureListener<?> listener)` Removes an existing event `listener` so it won't be notified when the future is completed.
    `void` | `setClosed()` Marks this future as closed and notifies all threads waiting for this future.

    - ### Methods inherited from class org.apache.mina.core.future.DefaultIoFuture

      `await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, getValue, isDone, join, join, setValue`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.mina.core.future.IoFuture

      `await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, isDone, join, join`

- - ### Constructor Detail

    - #### DefaultCloseFuture

          public DefaultCloseFuture(IoSession session)

      Creates a new instance.

  - ### Method Detail

    - #### isClosed

          public boolean isClosed()

      Description copied from interface: `CloseFuture`
      Returns `true` if the close request is finished and the session is closed.
      Specified by:
        `isClosed` in interface `CloseFuture`

    - #### setClosed

          public void setClosed()

      Description copied from interface: `CloseFuture`
      Marks this future as closed and notifies all threads waiting for this future. This method is invoked by MINA internally. Please do not call this method directly.
      Specified by:
        `setClosed` in interface `CloseFuture`

    - #### await

          public CloseFuture await()
                            throws InterruptedException

      Description copied from class: `DefaultIoFuture`
      Wait for the asynchronous operation to complete. The attached listeners will be notified when the operation is completed.
      Specified by:
        `await` in interface `CloseFuture`
      Specified by:
        `await` in interface `IoFuture`
      Overrides:
        `await` in class `DefaultIoFuture`
      Throws:
        `InterruptedException`

    - #### awaitUninterruptibly

          public CloseFuture awaitUninterruptibly()

      Description copied from class: `DefaultIoFuture`
      Wait for the asynchronous operation to complete uninterruptibly. The attached listeners will be notified when the operation is completed.
      Specified by:
        `awaitUninterruptibly` in interface `CloseFuture`
      Specified by:
        `awaitUninterruptibly` in interface `IoFuture`
      Overrides:
        `awaitUninterruptibly` in class `DefaultIoFuture`
      Returns:
        the current IoFuture

    - #### addListener

          public CloseFuture addListener(IoFutureListener<?> listener)

      Description copied from class: `DefaultIoFuture`
      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.
      Specified by:
        `addListener` in interface `CloseFuture`
      Specified by:
        `addListener` in interface `IoFuture`
      Overrides:
        `addListener` in class `DefaultIoFuture`

    - #### removeListener

          public CloseFuture removeListener(IoFutureListener<?> listener)

      Description copied from class: `DefaultIoFuture`
      Removes an existing event `listener` so it won't be notified when the future is completed.
      Specified by:
        `removeListener` in interface `CloseFuture`
      Specified by:
        `removeListener` in interface `IoFuture`
      Overrides:
        `removeListener` in class `DefaultIoFuture`

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