类 ListenableFutureAdapter<T,S>
java.lang.Object
cn.taketoday.util.concurrent.FutureAdapter<T,S>
cn.taketoday.util.concurrent.ListenableFutureAdapter<T,S>
- 类型参数:
T- the type of thisFutureS- the type of the adaptee'sFuture
- 所有已实现的接口:
ListenableFuture<T>,Future<T>
public abstract class ListenableFutureAdapter<T,S>
extends FutureAdapter<T,S>
implements ListenableFuture<T>
Abstract class that adapts a
ListenableFuture parameterized over S into a
ListenableFuture parameterized over T. All methods are delegated to the
adaptee, where FutureAdapter.get(), FutureAdapter.get(long, java.util.concurrent.TimeUnit),
and SuccessCallback.onSuccess(Object) call FutureAdapter.adapt(Object)
on the adaptee's result.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma
-
构造器概要
构造器限定符构造器说明protectedListenableFutureAdapter(ListenableFuture<S> adaptee) Construct a newListenableFutureAdapterwith the given adaptee. -
方法概要
修饰符和类型方法说明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.从类继承的方法 cn.taketoday.util.concurrent.FutureAdapter
adapt, adaptInternal, cancel, get, get, getAdaptee, isCancelled, isDone从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.util.concurrent.ListenableFuture
completable
-
构造器详细资料
-
ListenableFutureAdapter
Construct a newListenableFutureAdapterwith the given adaptee.- 参数:
adaptee- the future to adapt to
-
-
方法详细资料
-
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
-