Package org.apache.mina.common
Interface IoFuture
- All Known Subinterfaces:
CloseFuture,ConnectFuture,WriteFuture
- All Known Implementing Classes:
DefaultCloseFuture,DefaultConnectFuture,DefaultIoFuture,DefaultWriteFuture
public interface IoFuture
Represents the result of an ashynchronous I/O operation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(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 theIoSessionwhich is associated with this future.booleanisReady()Returns if the asynchronous operation is finished.voidjoin()Wait for the asynchronous operation to end.booleanjoin(long timeoutInMillis) 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.
-
Method Details
-
getSession
IoSession getSession()Returns theIoSessionwhich is associated with this future. -
getLock
Object getLock()Returns the lock object this future acquires. -
join
void join()Wait for the asynchronous operation to end. -
join
boolean join(long timeoutInMillis) Wait for the asynchronous operation to end with the specified timeout.- Returns:
- true if the operation is finished.
-
isReady
boolean isReady()Returns if the asynchronous operation is finished. -
addListener
Adds an event listener which is notified when the state of this future changes. -
removeListener
Removes an existing event listener which is notified when the state of this future changes.
-