Package org.apache.mina.common.support
Class DefaultIoFuture
- java.lang.Object
-
- org.apache.mina.common.support.DefaultIoFuture
-
- All Implemented Interfaces:
IoFuture
- Direct Known Subclasses:
DefaultCloseFuture,DefaultConnectFuture,DefaultWriteFuture
public class DefaultIoFuture extends java.lang.Object implements IoFuture
A default implementation ofIoFuture.
-
-
Constructor Summary
Constructors Constructor Description DefaultIoFuture(IoSession session)Creates a new instance.DefaultIoFuture(IoSession session, java.lang.Object lock)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(IoFutureListener listener)Adds an event listener which is notified when the state of this future changes.java.lang.ObjectgetLock()Returns the lock object this future acquires.IoSessiongetSession()Returns theIoSessionwhich is associated with this future.protected java.lang.ObjectgetValue()Returns the result of the asynchronous operation.booleanisReady()Returns if the asynchronous operation is finished.voidjoin()Wait for the asynchronous operation to end.booleanjoin(long timeoutMillis)Wait for the asynchronous operation to end with the specified timeout.voidremoveListener(IoFutureListener listener)Removes an existing event listener which is notified when the state of this future changes.protected voidsetValue(java.lang.Object newValue)Sets the result of the asynchronous operation, and mark it as finished.
-
-
-
Method Detail
-
getSession
public IoSession getSession()
Description copied from interface:IoFutureReturns theIoSessionwhich is associated with this future.- Specified by:
getSessionin interfaceIoFuture
-
getLock
public java.lang.Object getLock()
Description copied from interface:IoFutureReturns the lock object this future acquires.
-
join
public void join()
Description copied from interface:IoFutureWait for the asynchronous operation to end.
-
join
public boolean join(long timeoutMillis)
Description copied from interface:IoFutureWait for the asynchronous operation to end with the specified timeout.
-
isReady
public boolean isReady()
Description copied from interface:IoFutureReturns if the asynchronous operation is finished.
-
setValue
protected void setValue(java.lang.Object newValue)
Sets the result of the asynchronous operation, and mark it as finished.
-
getValue
protected java.lang.Object getValue()
Returns the result of the asynchronous operation.
-
addListener
public void addListener(IoFutureListener listener)
Description copied from interface:IoFutureAdds an event listener which is notified when the state of this future changes.- Specified by:
addListenerin interfaceIoFuture
-
removeListener
public void removeListener(IoFutureListener listener)
Description copied from interface:IoFutureRemoves an existing event listener which is notified when the state of this future changes.- Specified by:
removeListenerin interfaceIoFuture
-
-