IoFutureAbstractIoService.ServiceOperationFuture, CompositeIoFuture, DefaultCloseFuture, DefaultConnectFuture, DefaultReadFuture, DefaultWriteFuturepublic class DefaultIoFuture extends Object implements IoFuture
| Constructor | Description |
|---|---|
DefaultIoFuture(IoSession session) |
Creates a new instance associated with an
IoSession. |
| Modifier and Type | Method | Description |
|---|---|---|
IoFuture |
addListener(IoFutureListener<?> listener) |
Adds an event listener which is notified when
this future is completed.
|
IoFuture |
await() |
Wait for the asynchronous operation to complete.
|
boolean |
await(long timeoutMillis) |
Wait for the asynchronous operation to complete with the specified timeout.
|
boolean |
await(long timeout,
TimeUnit unit) |
Wait for the asynchronous operation to complete with the specified timeout.
|
IoFuture |
awaitUninterruptibly() |
Wait for the asynchronous operation to complete uninterruptibly.
|
boolean |
awaitUninterruptibly(long timeoutMillis) |
Wait for the asynchronous operation to complete with the specified timeout
uninterruptibly.
|
boolean |
awaitUninterruptibly(long timeout,
TimeUnit unit) |
Wait for the asynchronous operation to complete with the specified timeout
uninterruptibly.
|
IoSession |
getSession() |
|
protected Object |
getValue() |
|
boolean |
isDone() |
|
void |
join() |
Deprecated.
Replaced with
awaitUninterruptibly(). |
boolean |
join(long timeoutMillis) |
Deprecated.
Replaced with
awaitUninterruptibly(long). |
IoFuture |
removeListener(IoFutureListener<?> listener) |
Removes an existing event listener so it won't be notified when
the future is completed.
|
boolean |
setValue(Object newValue) |
Sets the result of the asynchronous operation, and mark it as finished.
|
public IoSession getSession()
getSession in interface IoFutureIoSession which is associated with this future.@Deprecated public void join()
awaitUninterruptibly().@Deprecated public boolean join(long timeoutMillis)
awaitUninterruptibly(long).public IoFuture await() throws InterruptedException
await in interface IoFutureInterruptedException - If the thread is interrupted while waitingpublic boolean await(long timeout,
TimeUnit unit)
throws InterruptedException
await in interface IoFuturetimeout - The maximum delay to wait before getting outunit - the type of unit for the delay (seconds, minutes...)InterruptedException - If the thread is interrupted while waitingpublic boolean await(long timeoutMillis)
throws InterruptedException
await in interface IoFuturetimeoutMillis - The maximum milliseconds to wait before getting outInterruptedException - If the thread is interrupted while waitingpublic IoFuture awaitUninterruptibly()
awaitUninterruptibly in interface IoFuturepublic boolean awaitUninterruptibly(long timeout,
TimeUnit unit)
awaitUninterruptibly in interface IoFuturetimeout - The maximum delay to wait before getting outunit - the type of unit for the delay (seconds, minutes...)public boolean awaitUninterruptibly(long timeoutMillis)
awaitUninterruptibly in interface IoFuturetimeoutMillis - The maximum milliseconds to wait before getting outpublic boolean isDone()
public boolean setValue(Object newValue)
newValue - The result to store into the Futuretrue if the value has been set, false if
the future already has a value (thus is in ready state)protected Object getValue()
public IoFuture addListener(IoFutureListener<?> listener)
addListener in interface IoFuturelistener - The listener to addpublic IoFuture removeListener(IoFutureListener<?> listener)
removeListener in interface IoFuturelistener - The listener to removeCopyright © 2004–2018 Apache MINA Project. All rights reserved.