类 ListenableFutureAdapter<T,S>
- java.lang.Object
- org.springframework.util.concurrent.FutureAdapter<T,S>
- org.springframework.util.concurrent.ListenableFutureAdapter<T,S>
- 类型参数:
T
- the type of thisFuture
S
- the type of the adaptee'sFuture
- 所有已实现的接口:
Future<T>
,ListenableFuture<T>
public abstract class ListenableFutureAdapter<T,S> extends FutureAdapter<T,S> implements ListenableFuture<T>
Abstract class that adapts aListenableFuture
parameterized over S into aListenableFuture
parameterized over T. All methods are delegated to the adaptee, whereFutureAdapter.get()
,FutureAdapter.get(long, java.util.concurrent.TimeUnit)
, andSuccessCallback.onSuccess(Object)
callFutureAdapter.adapt(Object)
on the adaptee's result.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma
构造器概要
构造器 限定符 构造器 说明 protected
ListenableFutureAdapter(ListenableFuture<S> adaptee)
Construct a newListenableFutureAdapter
with the given adaptee.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addCallback(ListenableFutureCallback<? super T> callback)
Register the givenListenableFutureCallback
.void
addCallback(SuccessCallback<? super T> successCallback, FailureCallback failureCallback)
Java 8 lambda-friendly alternative with success and failure callbacks.从类继承的方法 org.springframework.util.concurrent.FutureAdapter
adapt, cancel, get, get, getAdaptee, isCancelled, isDone
构造器详细资料
ListenableFutureAdapter
protected ListenableFutureAdapter(ListenableFuture<S> adaptee)
Construct a newListenableFutureAdapter
with the given adaptee.- 参数:
adaptee
- the future to adapt to
方法详细资料
addCallback
public void addCallback(ListenableFutureCallback<? super T> callback)
从接口复制的说明:ListenableFuture
Register the givenListenableFutureCallback
.- 指定者:
addCallback
在接口中ListenableFuture<T>
- 参数:
callback
- the callback to register
addCallback
public void addCallback(SuccessCallback<? super T> successCallback, FailureCallback failureCallback)
从接口复制的说明:ListenableFuture
Java 8 lambda-friendly alternative with success and failure callbacks.- 指定者:
addCallback
在接口中ListenableFuture<T>
- 参数:
successCallback
- the success callbackfailureCallback
- the failure callback