Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.mina.common
Interface ConnectFuture

All Superinterfaces:
  IoFuture

    public interface ConnectFuture

extends IoFuture

An `IoFuture` for asynchronous connect requests.

### Example

     IoConnector connector = ...;
     ConnectFuture future = connector.connect(...);
     future.join(); // Wait until the connection attempt is finished.
     IoSession session = future.getSession();
     session.write(...);

Version:
  $Rev: 555855 $, $Date: 2007-07-13 12:19:00 +0900 (Fri, 13 Jul 2007) $
Author:
  The Apache Directory Project (mina-dev@directory.apache.org)

Method Summary
`IoSession` | `getSession()` Returns `IoSession` which is the result of connect operation.
`boolean` | `isConnected()` Returns `true` if the connect operation is finished successfully.
`void` | `setException(Throwable exception)` Sets the exception caught due to connection failure and notifies all threads waiting for this future.
`void` | `setSession(IoSession session)` Sets the newly connected session and notifies all threads waiting for this future.

Methods inherited from interface org.apache.mina.common.IoFuture
`addListener, getLock, isReady, join, join, removeListener`

Method Detail

### getSession

    IoSession getSession()
                         throws RuntimeIOException

  Returns `IoSession` which is the result of connect operation.

  Specified by:
    `getSession` in interface `IoFuture`
  Returns:
    `null` if the connect operation is not finished yet
  Throws:
    `RuntimeIOException` - if connection attempt failed by an exception

### isConnected

    boolean isConnected()

  Returns `true` if the connect operation is finished successfully.

### setSession

    void setSession(IoSession session)

  Sets the newly connected session and notifies all threads waiting for this future. This method is invoked by MINA internally. Please do not call this method directly.

### setException

    void setException(Throwable exception)

  Sets the exception caught due to connection failure and notifies all threads waiting for this future. This method is invoked by MINA internally. Please do not call this method directly.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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