类 CompletableToListenableFutureAdapter<T>
java.lang.Object
cn.taketoday.util.concurrent.CompletableToListenableFutureAdapter<T>
- 类型参数:
T- the result type returned by this Future'sgetmethod
- 所有已实现的接口:
ListenableFuture<T>,Future<T>
- 直接已知子类:
MonoToListenableFutureAdapter
- 从以下版本开始:
- 4.0
- 作者:
- Sebastien Deleuze, Juergen Hoeller, TODAY
-
字段概要
字段 -
构造器概要
构造器构造器说明CompletableToListenableFutureAdapter(CompletableFuture<T> completableFuture) Create a new adapter for the givenCompletableFuture.CompletableToListenableFutureAdapter(CompletionStage<T> completionStage) Create a new adapter for the givenCompletionStage. -
方法概要
修饰符和类型方法说明voidaddCallback(ListenableFutureCallback<? super T> callback) Register the givenListenableFutureCallback.voidaddCallback(SuccessCallback<? super T> successCallback, FailureCallback failureCallback) Java 8 lambda-friendly alternative with success and failure callbacks.booleancancel(boolean mayInterruptIfRunning) Expose thisListenableFutureas a JDKCompletableFuture.get()booleanbooleanisDone()
-
字段详细资料
-
completableFuture
-
callbacks
-
-
构造器详细资料
-
CompletableToListenableFutureAdapter
Create a new adapter for the givenCompletionStage. -
CompletableToListenableFutureAdapter
Create a new adapter for the givenCompletableFuture.
-
-
方法详细资料
-
addCallback
从接口复制的说明:ListenableFutureRegister the givenListenableFutureCallback.- 指定者:
addCallback在接口中ListenableFuture<T>- 参数:
callback- the callback to register
-
addCallback
public void addCallback(SuccessCallback<? super T> successCallback, FailureCallback failureCallback) 从接口复制的说明:ListenableFutureJava 8 lambda-friendly alternative with success and failure callbacks.- 指定者:
addCallback在接口中ListenableFuture<T>- 参数:
successCallback- the success callbackfailureCallback- the failure callback
-
completable
从接口复制的说明:ListenableFutureExpose thisListenableFutureas a JDKCompletableFuture.- 指定者:
completable在接口中ListenableFuture<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- 指定者:
isCancelled在接口中Future<T>
-
isDone
public boolean isDone() -
get
- 指定者:
get在接口中Future<T>- 抛出:
InterruptedExceptionExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - 指定者:
get在接口中Future<T>- 抛出:
InterruptedExceptionExecutionExceptionTimeoutException
-