org.apache.mina.common.support

Class DefaultIoFuture

Implemented Interfaces:
IoFuture
Known Direct Subclasses:
DefaultCloseFuture, DefaultConnectFuture, DefaultWriteFuture

public class DefaultIoFuture
extends java.lang.Object
implements IoFuture

A default implementation of IoFuture.

Constructor Summary

DefaultIoFuture(IoSession session)
Creates a new instance.
DefaultIoFuture(IoSession session, Object lock)
Creates a new instance.

Method Summary

void
addListener(IoFutureListener listener)
Object
getLock()
IoSession
getSession()
protected Object
getValue()
Returns the result of the asynchronous operation.
boolean
isReady()
void
join()
boolean
join(long timeoutMillis)
void
removeListener(IoFutureListener listener)
protected void
setValue(Object newValue)
Sets the result of the asynchronous operation, and mark it as finished.

Constructor Details

DefaultIoFuture

public DefaultIoFuture(IoSession session)
Creates a new instance.
Parameters:
session - an IoSession which is associated with this future

DefaultIoFuture

public DefaultIoFuture(IoSession session,
                       Object lock)
Creates a new instance.
Parameters:
session - an IoSession which is associated with this future

Method Details

addListener

public void addListener(IoFutureListener listener)
Specified by:
addListener in interface IoFuture

getLock

public Object getLock()
Specified by:
getLock in interface IoFuture

getSession

public IoSession getSession()
Specified by:
getSession in interface IoFuture

getValue

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

isReady

public boolean isReady()
Specified by:
isReady 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

removeListener

public void removeListener(IoFutureListener listener)
Specified by:
removeListener in interface IoFuture

setValue

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