org.apache.mina.common
Class DefaultIoFuture

java.lang.Object
  extended by org.apache.mina.common.DefaultIoFuture
All Implemented Interfaces:
IoFuture
Direct Known Subclasses:
AbstractIoService.ServiceOperationFuture, CompositeIoFuture, DefaultCloseFuture, DefaultConnectFuture, DefaultReadFuture, DefaultWriteFuture

public class DefaultIoFuture
extends Object
implements IoFuture

A default implementation of IoFuture.

Version:
$Rev: 600818 $, $Date: 2007-12-04 08:37:24 +0100 (Tue, 04 Dec 2007) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
DefaultIoFuture(IoSession session)
          Creates a new instance.
 
Method Summary
 IoFuture addListener(IoFutureListener<?> listener)
          Adds an event listener which is notified when the state of this future changes.
 IoFuture await()
          Wait for the asynchronous operation to end.
 boolean await(long timeoutMillis)
          Wait for the asynchronous operation to end with the specified timeout.
 boolean await(long timeout, TimeUnit unit)
          Wait for the asynchronous operation to end with the specified timeout.
 IoFuture awaitUninterruptibly()
          Wait for the asynchronous operation to end uninterruptibly.
 boolean awaitUninterruptibly(long timeoutMillis)
          Wait for the asynchronous operation to end with the specified timeout uninterruptibly.
 boolean awaitUninterruptibly(long timeout, TimeUnit unit)
          Wait for the asynchronous operation to end with the specified timeout uninterruptibly.
 IoSession getSession()
          Returns the IoSession which is associated with this future.
protected  Object getValue()
          Returns the result of the asynchronous operation.
 boolean isReady()
          Returns if the asynchronous operation is finished.
 void join()
           
 boolean join(long timeoutMillis)
           
 IoFuture removeListener(IoFutureListener<?> listener)
          Removes an existing event listener which is notified when the state of this future changes.
protected  void setValue(Object newValue)
          Sets the result of the asynchronous operation, and mark it as finished.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIoFuture

public DefaultIoFuture(IoSession session)
Creates a new instance.

Parameters:
session - an IoSession which is associated with this future
Method Detail

getSession

public IoSession getSession()
Description copied from interface: IoFuture
Returns the IoSession which is associated with this future.

Specified by:
getSession in interface IoFuture

join

public void join()
Specified by:
join in interface IoFuture

join

public boolean join(long timeoutMillis)
Specified by:
join in interface IoFuture

await

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

Specified by:
await in interface IoFuture
Throws:
InterruptedException

await

public boolean await(long timeout,
                     TimeUnit unit)
              throws InterruptedException
Description copied from interface: IoFuture
Wait for the asynchronous operation to end with the specified timeout.

Specified by:
await in interface IoFuture
Returns:
true if the operation is finished.
Throws:
InterruptedException

await

public boolean await(long timeoutMillis)
              throws InterruptedException
Description copied from interface: IoFuture
Wait for the asynchronous operation to end with the specified timeout.

Specified by:
await in interface IoFuture
Returns:
true if the operation is finished.
Throws:
InterruptedException

awaitUninterruptibly

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

Specified by:
awaitUninterruptibly in interface IoFuture

awaitUninterruptibly

public boolean awaitUninterruptibly(long timeout,
                                    TimeUnit unit)
Description copied from interface: IoFuture
Wait for the asynchronous operation to end with the specified timeout uninterruptibly.

Specified by:
awaitUninterruptibly in interface IoFuture
Returns:
true if the operation is finished.

awaitUninterruptibly

public boolean awaitUninterruptibly(long timeoutMillis)
Description copied from interface: IoFuture
Wait for the asynchronous operation to end with the specified timeout uninterruptibly.

Specified by:
awaitUninterruptibly in interface IoFuture
Returns:
true if the operation is finished.

isReady

public boolean isReady()
Description copied from interface: IoFuture
Returns if the asynchronous operation is finished.

Specified by:
isReady in interface IoFuture

setValue

protected void setValue(Object newValue)
Sets the result of the asynchronous operation, and mark it as finished.


getValue

protected Object getValue()
Returns the result of the asynchronous operation.


addListener

public IoFuture 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

public IoFuture 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.