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
A default implementation of
IoFuture
.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultIoFuture
(IoSession session) Creates a new instance.DefaultIoFuture
(IoSession session, Object lock) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(IoFutureListener listener) Adds an event listener which is notified when the state of this future changes.getLock()
Returns the lock object this future acquires.Returns theIoSession
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()
Wait for the asynchronous operation to end.boolean
join
(long timeoutMillis) Wait for the asynchronous operation to end with the specified timeout.void
removeListener
(IoFutureListener listener) Removes an existing event listener which is notified when the state of this future changes.protected void
Sets the result of the asynchronous operation, and mark it as finished.
-
Constructor Details
-
Method Details
-
getSession
Description copied from interface:IoFuture
Returns theIoSession
which is associated with this future.- Specified by:
getSession
in interfaceIoFuture
-
getLock
Description copied from interface:IoFuture
Returns the lock object this future acquires. -
join
public void join()Description copied from interface:IoFuture
Wait for the asynchronous operation to end. -
join
public boolean join(long timeoutMillis) Description copied from interface:IoFuture
Wait for the asynchronous operation to end with the specified timeout. -
isReady
public boolean isReady()Description copied from interface:IoFuture
Returns if the asynchronous operation is finished. -
setValue
Sets the result of the asynchronous operation, and mark it as finished. -
getValue
Returns the result of the asynchronous operation. -
addListener
Description copied from interface:IoFuture
Adds an event listener which is notified when the state of this future changes.- Specified by:
addListener
in interfaceIoFuture
-
removeListener
Description copied from interface:IoFuture
Removes an existing event listener which is notified when the state of this future changes.- Specified by:
removeListener
in interfaceIoFuture
-