Futures#withTimeout.
Future that delegates to another but will finish early (via a TimeoutException wrapped
in an ExecutionException) if the specified duration expires. The delegate future is
interrupted and cancelled if it times out.
| Modifier and Type | Class and Description |
|---|---|
| private static class | TimeoutFuture.
A runnable that is called when the delegate or the timer completes. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private ListenableFuture | |
| private ScheduledFuture |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected void | afterDone()
Overrides com. |
| pack-priv static <V extends @Nullable Object> ListenableFuture | create(ListenableFuture<V> delegate, long time, TimeUnit unit, ScheduledExecutorService scheduledExecutor)
|
| protected String | pendingToString()
Overrides com. |
| delegateRef | back to summary |
|---|---|
| private ListenableFuture<V> delegateRef
| |
| timer | back to summary |
|---|---|
| private ScheduledFuture<?> timer
| |
| TimeoutFuture | back to summary |
|---|---|
| private TimeoutFuture(ListenableFuture<V> delegate) | |
| afterDone | back to summary |
|---|---|
| protected void afterDone() Overrides com. Doc from com. Callback method that is called exactly once after the future is completed. If The default implementation of this method in
| |
| create | back to summary |
|---|---|
| pack-priv static <V extends @Nullable Object> ListenableFuture | |
| pendingToString | back to summary |
|---|---|
| protected String pendingToString() Overrides com. Doc from com. Provide a human-readable explanation of why this future has not yet completed.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv TimeoutFuture |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| timeoutFutureRef | back to summary |
|---|---|
| pack-priv TimeoutFuture<V> timeoutFutureRef
| |
| Fire | back to summary |
|---|---|
| pack-priv Fire(TimeoutFuture<V> timeoutFuture) | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized Throwable | fillInStackTrace()
Overrides java. |
| TimeoutFutureException | back to summary |
|---|---|
| private TimeoutFutureException(String message) | |
| fillInStackTrace | back to summary |
|---|---|
| public synchronized Throwable fillInStackTrace() Overrides java. Doc from java. Fills in the execution stack trace. This method records within this
If the stack trace of this | |