类 FutureAdapter<T,S>
java.lang.Object
cn.taketoday.util.concurrent.FutureAdapter<T,S>
- 类型参数:
T- the type of thisFutureS- the type of the adaptee'sFuture
- 所有已实现的接口:
Future<T>
- 直接已知子类:
ListenableFutureAdapter
Abstract class that adapts a
Future parameterized over S into a Future
parameterized over T. All methods are delegated to the adaptee, where get()
and get(long, TimeUnit) call adapt(Object) on the adaptee's result.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma
-
构造器概要
构造器限定符构造器说明protectedFutureAdapter(Future<S> adaptee) Constructs a newFutureAdapterwith the given adaptee. -
方法概要
-
构造器详细资料
-
FutureAdapter
Constructs a newFutureAdapterwith the given adaptee.- 参数:
adaptee- the future to delegate to
-
-
方法详细资料
-
getAdaptee
Returns the adaptee. -
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- 指定者:
isCancelled在接口中Future<T>
-
isDone
public boolean isDone() -
get
- 指定者:
get在接口中Future<T>- 抛出:
InterruptedExceptionExecutionException
-
get
@Nullable public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - 指定者:
get在接口中Future<T>- 抛出:
InterruptedExceptionExecutionExceptionTimeoutException
-
adapt
Adapts the given adaptee's result into T.- 返回:
- the adapted result
- 抛出:
ExecutionException
-