protected static class BasePromise.Done<V> extends Object implements Promise<V>
Promise.Listener<F extends Future<?>>| 限定符和类型 | 方法和说明 |
|---|---|
Promise<V> |
addListener(Promise.Listener<? extends Future<V>> listener)
添加监听器
|
void |
cancel()
取消
|
boolean |
cancel(boolean mayInterruptIfRunning) |
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
Throwable |
getFailCause()
(若)失败的原因
|
boolean |
isCancelled() |
boolean |
isDone() |
public boolean isCancelled()
isCancelled 在接口中 Future<V>public V get() throws InterruptedException, ExecutionException
get 在接口中 Future<V>InterruptedExceptionExecutionExceptionpublic V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get 在接口中 Future<V>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic void cancel()
throws IllegalStateException,
UnsupportedOperationException
Cancelablecancel 在接口中 CancelableIllegalStateException - 状态不适合时UnsupportedOperationException - 操作不支持public Promise<V> addListener(Promise.Listener<? extends Future<V>> listener)
PromiseaddListener 在接口中 Promise<V>listener - 要添加的监听器public Throwable getFailCause()
PromisegetFailCause 在接口中 Promise<V>Copyright © 2022. All rights reserved.