org.apache.mina.common
Class DefaultCloseFuture

java.lang.Object
  extended by org.apache.mina.common.DefaultIoFuture
      extended by org.apache.mina.common.DefaultCloseFuture
All Implemented Interfaces:
CloseFuture, IoFuture

public class DefaultCloseFuture
extends DefaultIoFuture
implements CloseFuture

A default implementation of CloseFuture.

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

Constructor Summary
DefaultCloseFuture(IoSession session)
          Creates a new instance.
 
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 class org.apache.mina.common.DefaultIoFuture
await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, getValue, isReady, 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.common.IoFuture
await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, isReady, 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 interface: IoFuture
Wait for the asynchronous operation to end.

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 interface: IoFuture
Wait for the asynchronous operation to end uninterruptibly.

Specified by:
awaitUninterruptibly in interface CloseFuture
Specified by:
awaitUninterruptibly in interface IoFuture
Overrides:
awaitUninterruptibly in class DefaultIoFuture

addListener

public 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 CloseFuture
Specified by:
addListener in interface IoFuture
Overrides:
addListener in class DefaultIoFuture

removeListener

public 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 CloseFuture
Specified by:
removeListener in interface IoFuture
Overrides:
removeListener in class DefaultIoFuture


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