org.apache.mina.transport

## Class ConnectFuture

- java.lang.Object
- - org.apache.mina.util.AbstractIoFuture<IoSession>
  - - org.apache.mina.transport.ConnectFuture

- All Implemented Interfaces:
    Future<IoSession>, IoFuture<IoSession>

      public class ConnectFuture
      extends AbstractIoFuture<IoSession>

  `Future` for waiting session connection.
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConnectFuture()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `cancelOwner(boolean mayInterruptIfRunning)` Notify the owner of this future that a client is attempting to cancel.
    `void` | `cannotConnect(Exception e)` Can't connect
    `void` | `complete(IoSession session)` session connected
    `void` | `error(Exception e)` connection error

    - ### Methods inherited from class org.apache.mina.util.AbstractIoFuture

      `cancel, get, get, isCancelled, isDone, register, scheduleException, scheduleResult, setException, setResult`

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

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

- - ### Constructor Detail

    - #### ConnectFuture

          public ConnectFuture()

  - ### Method Detail

    - #### cancelOwner

          protected boolean cancelOwner(boolean mayInterruptIfRunning)

      Description copied from class: `AbstractIoFuture`
      Notify the owner of this future that a client is attempting to cancel. This attempt will fail if the task has already completed, has already been cancelled, or could not be cancelled for some other reason. If successful, and this task has not started when `cancel` is called, this task should never run. If the task has already started, then the `mayInterruptIfRunning` parameter determines whether the thread executing this task should be interrupted in an attempt to stop the task.

      After this method returns, subsequent calls to `AbstractIoFuture.isDone()` will always return `true`. Subsequent calls to `AbstractIoFuture.isCancelled()` will always return `true` if this method returned `true`.

      Note: implementations must never throw an exception.
      Specified by:
        `cancelOwner` in class `AbstractIoFuture<IoSession>`
      Parameters:
        `mayInterruptIfRunning` - `true` if the owner executing this task should be interrupted; otherwise, in-progress tasks are allowed to complete
      Returns:
        `false` if the task could not be cancelled, typically because it has already completed normally; `true` otherwise

    - #### cannotConnect

          public void cannotConnect(Exception e)

      Can't connect

    - #### complete

          public void complete(IoSession session)

      session connected

    - #### error

          public void error(Exception e)

      connection error

Copyright © 2009–2013 Apache MINA Project. All rights reserved.