org.apache.mina.common
Interface CloseFuture

All Superinterfaces:
IoFuture
All Known Implementing Classes:
DefaultCloseFuture

public interface CloseFuture
extends IoFuture

An IoFuture for asynchronous close requests.

Example

 IoSession session = ...;
 CloseFuture future = session.close();
 // Wait until the connection is closed
 future.awaitUninterruptibly();
 // Now connection should be closed.
 assert future.isClosed();
 

Version:
$Rev: 588579 $, $Date: 2007-10-26 11:21:01 +0200 (Fri, 26 Oct 2007) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Method Summary
 CloseFuture addListener(IoFutureListener<?> listener)
          Adds an event listener which is notified when the state of this future changes.
 CloseFuture await()
          Wait for the asynchronous operation to end.
 CloseFuture awaitUninterruptibly()
          Wait for the asynchronous operation to end 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 which is notified when the state of this future changes.
 void setClosed()
          Marks this future as closed and notifies all threads waiting for this future.
 
Methods inherited from interface org.apache.mina.common.IoFuture
await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, isReady, join, join
 

Method Detail

isClosed

boolean isClosed()
Returns true if the close request is finished and the session is closed.


setClosed

void setClosed()
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.


await

CloseFuture await()
                  throws InterruptedException
Description copied from interface: IoFuture
Wait for the asynchronous operation to end.

Specified by:
await in interface IoFuture
Throws:
InterruptedException

awaitUninterruptibly

CloseFuture awaitUninterruptibly()
Description copied from interface: IoFuture
Wait for the asynchronous operation to end uninterruptibly.

Specified by:
awaitUninterruptibly in interface IoFuture

addListener

CloseFuture addListener(IoFutureListener<?> listener)
Description copied from interface: IoFuture
Adds an event listener which is notified when the state of this future changes.

Specified by:
addListener in interface IoFuture

removeListener

CloseFuture removeListener(IoFutureListener<?> listener)
Description copied from interface: IoFuture
Removes an existing event listener which is notified when the state of this future changes.

Specified by:
removeListener in interface IoFuture


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