public static class ListenableFuture.CompletedFailure<T> extends java.lang.Object implements ListenableFuture<T>
ListenableFuture.CompletedFailure<T>| Constructor and Description |
|---|
CompletedFailure(java.lang.String message,
java.lang.Throwable t) |
CompletedFailure(java.lang.Throwable t) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(java.lang.Throwable t)
|
ListenableFuture<T> |
addListener(java.lang.Runnable listener,
java.util.concurrent.Executor exec)
Adds a listener and executor to the ListenableFuture.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
void |
done()
Terminate and if there is no exception, mark this Future as done and release the internal lock.
|
T |
get() |
T |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
java.util.concurrent.CompletableFuture<T> |
toCompletableFuture() |
void |
touch()
Touch the current instance to prevent external service to times out.
|
public CompletedFailure(java.lang.Throwable t)
public CompletedFailure(java.lang.String message,
java.lang.Throwable t)
public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface java.util.concurrent.Future<T>public boolean isCancelled()
isCancelled in interface java.util.concurrent.Future<T>public boolean isDone()
isDone in interface java.util.concurrent.Future<T>public T get() throws java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Future<T>java.util.concurrent.ExecutionExceptionpublic T get(long timeout, java.util.concurrent.TimeUnit unit) throws java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Future<T>java.util.concurrent.ExecutionExceptionpublic void done()
ListenableFuturedone in interface ListenableFuture<T>public void abort(java.lang.Throwable t)
ListenableFutureabort in interface ListenableFuture<T>t - the exceptionpublic void touch()
ListenableFuturetouch in interface ListenableFuture<T>public ListenableFuture<T> addListener(java.lang.Runnable listener, java.util.concurrent.Executor exec)
ListenableFutureFuture's computation is
complete.
null, in that case executor will be executed
in the thread where completion happens.
addListener in interface ListenableFuture<T>listener - the listener to run when the computation is complete.exec - the executor to run the listener in.public java.util.concurrent.CompletableFuture<T> toCompletableFuture()
toCompletableFuture in interface ListenableFuture<T>Copyright © 2018. All Rights Reserved.