protected static class BasePromise.Wrap<V> extends BasePromise<V> implements Runnable
BasePromise.Done<V>, BasePromise.Singleton, BasePromise.Trans<R,V>, BasePromise.Wrap<V>, BasePromise.WrapExceptionPromise.Listener<F extends Future<?>>_nil, STATUS_CANCELLED, STATUS_DONE, STATUS_FAILED, STATUS_PENDING| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
protected void |
cancelTask() |
boolean |
complete(V value)
处理完成,执行该方法后调用
BasePromise.isDone()总返回true |
boolean |
fail(Throwable cause)
处理异常后结束,执行该方法后调用
BasePromise.isDone()总返回true |
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
run() |
void |
start(long period) |
addListener, cancel, cancel0, done, err, fail0, getFailCause, getValue, nil, notifyListener, notifyListeners, reset, setCause, valueOfpublic void start(long period)
protected void cancelTask()
public boolean complete(V value)
BasePromiseBasePromise.isDone()总返回truecomplete 在类中 BasePromise<V>value - 完成时的返回值public boolean fail(Throwable cause)
BasePromiseBasePromise.isDone()总返回truefail 在类中 BasePromise<V>cause - 异常的原因public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled 在接口中 Future<V>isCancelled 在类中 BasePromise<V>public V get() throws InterruptedException, ExecutionException
get 在接口中 Future<V>get 在类中 BasePromise<V>InterruptedExceptionExecutionExceptionpublic V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get 在接口中 Future<V>get 在类中 BasePromise<V>InterruptedExceptionExecutionExceptionTimeoutExceptionCopyright © 2022. All rights reserved.