public interface IoFuture
IoSession
.
Can be listened for completion using a IoFutureListener
.限定符和类型 | 方法和说明 |
---|---|
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() |
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.
|
IoFuture await() throws java.lang.InterruptedException
java.lang.InterruptedException
- If the thread is interrupted while waitingboolean await(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
timeout
- The maximum delay to wait before getting outunit
- the type of unit for the delay (seconds, minutes...)java.lang.InterruptedException
- If the thread is interrupted while waitingboolean await(long timeoutMillis) throws java.lang.InterruptedException
timeoutMillis
- The maximum milliseconds to wait before getting outjava.lang.InterruptedException
- If the thread is interrupted while waitingIoFuture awaitUninterruptibly()
boolean awaitUninterruptibly(long timeout, java.util.concurrent.TimeUnit unit)
timeout
- The maximum delay to wait before getting outunit
- the type of unit for the delay (seconds, minutes...)boolean awaitUninterruptibly(long timeoutMillis)
timeoutMillis
- The maximum milliseconds to wait before getting out@Deprecated void join()
awaitUninterruptibly()
.@Deprecated boolean join(long timeoutMillis)
awaitUninterruptibly(long)
.timeoutMillis
- The time to wait for the join before bailing outboolean isDone()
IoFuture addListener(IoFutureListener<?> listener)
listener
- The listener to addIoFuture removeListener(IoFutureListener<?> listener)
listener
- The listener to remove