类 FutureAdapter<T,S>
- java.lang.Object
- org.springframework.util.concurrent.FutureAdapter<T,S>
- 类型参数:
T
- the type of thisFuture
S
- the type of the adaptee'sFuture
- 所有已实现的接口:
Future<T>
- 直接已知子类:
ListenableFutureAdapter
public abstract class FutureAdapter<T,S> extends Object implements Future<T>
Abstract class that adapts aFuture
parameterized over S into aFuture
parameterized over T. All methods are delegated to the adaptee, whereget()
andget(long, TimeUnit)
calladapt(Object)
on the adaptee's result.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma
构造器概要
构造器 限定符 构造器 说明 protected
FutureAdapter(Future<S> adaptee)
Constructs a newFutureAdapter
with the given adaptee.
构造器详细资料
FutureAdapter
protected FutureAdapter(Future<S> adaptee)
Constructs a newFutureAdapter
with the given adaptee.- 参数:
adaptee
- the future to delegate to
方法详细资料
getAdaptee
protected Future<S> getAdaptee()
Returns the adaptee.
isCancelled
public boolean isCancelled()
- 指定者:
isCancelled
在接口中Future<T>
get
public T get() throws InterruptedException, ExecutionException
- 指定者:
get
在接口中Future<T>
- 抛出:
InterruptedException
ExecutionException
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
adapt
protected abstract T adapt(S adapteeResult) throws ExecutionException
Adapts the given adaptee's result into T.- 返回:
- the adapted result
- 抛出:
ExecutionException