public class DefaultIoFuture extends java.lang.Object implements IoFuture
| 构造器和说明 |
|---|
DefaultIoFuture(IoSession session)
Creates a new instance associated with an
IoSession. |
| 限定符和类型 | 方法和说明 |
|---|---|
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,
java.util.concurrent.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,
java.util.concurrent.TimeUnit unit)
Wait for the asynchronous operation to complete with the specified timeout
uninterruptibly.
|
IoSession |
getSession() |
protected java.lang.Object |
getValue() |
boolean |
isDone() |
void |
join()
已过时。
Replaced with
awaitUninterruptibly(). |
boolean |
join(long timeoutMillis)
已过时。
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(java.lang.Object newValue)
Sets the result of the asynchronous operation, and mark it as finished.
|
public IoSession getSession()
getSession 在接口中 IoFutureIoSession which is associated with this future.@Deprecated public void join()
awaitUninterruptibly().@Deprecated public boolean join(long timeoutMillis)
awaitUninterruptibly(long).public IoFuture await() throws java.lang.InterruptedException
public boolean await(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
public boolean await(long timeoutMillis)
throws java.lang.InterruptedException
public IoFuture awaitUninterruptibly()
awaitUninterruptibly 在接口中 IoFuturepublic boolean awaitUninterruptibly(long timeout,
java.util.concurrent.TimeUnit unit)
awaitUninterruptibly 在接口中 IoFuturetimeout - The maximum delay to wait before getting outunit - the type of unit for the delay (seconds, minutes...)public boolean awaitUninterruptibly(long timeoutMillis)
awaitUninterruptibly 在接口中 IoFuturetimeoutMillis - The maximum milliseconds to wait before getting outpublic boolean setValue(java.lang.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 java.lang.Object getValue()
public IoFuture addListener(IoFutureListener<?> listener)
addListener 在接口中 IoFuturelistener - The listener to addpublic IoFuture removeListener(IoFutureListener<?> listener)
removeListener 在接口中 IoFuturelistener - The listener to remove