public interface WaitableFuture
true is returned from one of the awaitXXX methods then the operation has completed. However,
the caller has to determine whether it was a successful or failed completion.| Modifier and Type | Method and Description |
|---|---|
default boolean |
await()
Wait
Long.MAX_VALUE msec. |
default boolean |
await(CancelOption... options)
Wait
Long.MAX_VALUE msec. |
default boolean |
await(Duration timeout)
Wait for the asynchronous operation to complete with the specified timeout.
|
default boolean |
await(Duration timeout,
CancelOption... options)
Wait for the asynchronous operation to complete with the specified timeout.
|
default boolean |
await(long timeoutMillis)
Wait for the asynchronous operation to complete with the specified timeout.
|
boolean |
await(long timeoutMillis,
CancelOption... options)
Wait for the asynchronous operation to complete with the specified timeout.
|
default boolean |
await(long timeout,
TimeUnit unit)
Wait for the asynchronous operation to complete with the specified timeout.
|
default boolean |
await(long timeout,
TimeUnit unit,
CancelOption... options)
Wait for the asynchronous operation to complete with the specified timeout.
|
default boolean |
awaitUninterruptibly()
Wait
Long.MAX_VALUE msec. |
default boolean |
awaitUninterruptibly(CancelOption... options)
Wait
Long.MAX_VALUE msec. |
default boolean |
awaitUninterruptibly(Duration timeoutMillis)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
|
default boolean |
awaitUninterruptibly(Duration timeoutMillis,
CancelOption... options)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
|
default boolean |
awaitUninterruptibly(long timeoutMillis)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
|
boolean |
awaitUninterruptibly(long timeoutMillis,
CancelOption... options)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
|
default boolean |
awaitUninterruptibly(long timeout,
TimeUnit unit)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
|
default boolean |
awaitUninterruptibly(long timeout,
TimeUnit unit,
CancelOption... options)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
|
Object |
getId() |
boolean |
isDone() |
Object getId()
toString() valuedefault boolean await()
throws IOException
Long.MAX_VALUE msec. for the asynchronous operation to complete. The attached listeners will be
notified when the operation is completed.true if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interruptedawait(long, CancelOption[])default boolean await(CancelOption... options) throws IOException
Long.MAX_VALUE msec. for the asynchronous operation to complete. The attached listeners will be
notified when the operation is completed.options - Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the
future is not Cancellable.true if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interruptedawait(long, CancelOption[])default boolean await(long timeout,
TimeUnit unit)
throws IOException
timeout - The number of time units to waitunit - The TimeUnit for waitingtrue if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interruptedawait(long, CancelOption[])default boolean await(long timeout,
TimeUnit unit,
CancelOption... options)
throws IOException
timeout - The number of time units to waitunit - The TimeUnit for waitingoptions - Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the
future is not Cancellable.true if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interruptedawait(long, CancelOption[])default boolean await(Duration timeout) throws IOException
timeout - The maximum duration to wait, null to wait forevertrue if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interruptedawait(long, CancelOption[])default boolean await(Duration timeout, CancelOption... options) throws IOException
timeout - The maximum duration to wait, null to wait foreveroptions - Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the
future is not Cancellable.true if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interruptedawait(long, CancelOption[])default boolean await(long timeoutMillis)
throws IOException
timeoutMillis - Wait time in millisecondstrue if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interruptedboolean await(long timeoutMillis,
CancelOption... options)
throws IOException
timeoutMillis - Wait time in millisecondsoptions - Optional CancelOptions defining the behavior on time-out or interrupt; ignored if
the future is not Cancellable.true if the operation is completed.IOException - if failed - specifically InterruptedIOException if waiting was interrupteddefault boolean awaitUninterruptibly()
Long.MAX_VALUE msec. for the asynchronous operation to complete uninterruptibly. The attached
listeners will be notified when the operation is completed.true if the operation is completed.awaitUninterruptibly(long, CancelOption[])default boolean awaitUninterruptibly(CancelOption... options)
Long.MAX_VALUE msec. for the asynchronous operation to complete uninterruptibly. The attached
listeners will be notified when the operation is completed.options - Optional CancelOptions defining the behavior on time-out; ignored if the future is not
Cancellable.true if the operation is completed.awaitUninterruptibly(long, CancelOption[])default boolean awaitUninterruptibly(long timeout,
TimeUnit unit)
timeout - The number of time units to waitunit - The TimeUnit for waitingtrue if the operation is completed.awaitUninterruptibly(long, CancelOption[])default boolean awaitUninterruptibly(long timeout,
TimeUnit unit,
CancelOption... options)
timeout - The number of time units to waitunit - The TimeUnit for waitingoptions - Optional CancelOptions defining the behavior on time-out; ignored if the future is not
Cancellable.true if the operation is completed.awaitUninterruptibly(long, CancelOption[])default boolean awaitUninterruptibly(Duration timeoutMillis)
timeoutMillis - Wait time, null to wait forevertrue if the operation is finished.default boolean awaitUninterruptibly(Duration timeoutMillis, CancelOption... options)
timeoutMillis - Wait time, null to wait foreveroptions - Optional CancelOptions defining the behavior on time-out; ignored if the future is
not Cancellable.true if the operation is finished.default boolean awaitUninterruptibly(long timeoutMillis)
timeoutMillis - Wait time in millisecondstrue if the operation is finished.boolean awaitUninterruptibly(long timeoutMillis,
CancelOption... options)
timeoutMillis - Wait time in millisecondsoptions - Optional CancelOptions defining the behavior on time-out; ignored if the future is
not Cancellable.true if the operation is finished.boolean isDone()
true if the asynchronous operation is completed. Note: it is up to the caller to
determine whether it was a successful or failed completion.Copyright © 2018–2024 The Apache Software Foundation. All rights reserved.