类 FailedFuture<V>
java.lang.Object
cn.taketoday.util.concurrent.AbstractFuture<V>
cn.taketoday.util.concurrent.CompleteFuture<V>
cn.taketoday.util.concurrent.FailedFuture<V>
- 所有已实现的接口:
ListenableFuture<V>,Future<V>
The
CompleteFuture which is failed already.- 从以下版本开始:
- 4.0 2024/2/26 21:31
- 作者:
- Harry Yang
-
字段概要
字段 -
构造器概要
构造器构造器说明FailedFuture(Throwable cause) Creates a new instance.FailedFuture(Executor executor, Throwable cause) Creates a new instance. -
方法概要
修饰符和类型方法说明getCause()Returns the cause of the failed operation if the operation failed.getNow()Return the result without blocking.booleanReturnstrueif and only if the operation was completed successfully.obtain()Return the result without blocking.sync()Waits for this future until it is done, and rethrows the cause of the failure if this future failed.Waits for this future until it is done, and rethrows the cause of the failure if this future failed.从类继承的方法 cn.taketoday.util.concurrent.CompleteFuture
addListener, addListeners, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, cancel, executor, isCancellable, isCancelled, isDone, removeListener, removeListeners从类继承的方法 cn.taketoday.util.concurrent.AbstractFuture
get, get从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.util.concurrent.ListenableFuture
addListener, completable, onFailure, onSuccess
-
字段详细资料
-
cause
-
-
构造器详细资料
-
FailedFuture
Creates a new instance.- 参数:
cause- the cause of failure
-
FailedFuture
Creates a new instance.- 参数:
executor- theExecutorassociated with this futurecause- the cause of failure
-
-
方法详细资料
-
getCause
从接口复制的说明:ListenableFutureReturns the cause of the failed operation if the operation failed.- 返回:
- the cause of the failure.
nullif succeeded or this future is not completed yet.
-
isSuccess
public boolean isSuccess()从接口复制的说明:ListenableFutureReturnstrueif and only if the operation was completed successfully. -
sync
从接口复制的说明:ListenableFutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.- 指定者:
sync在接口中ListenableFuture<V>- 覆盖:
sync在类中CompleteFuture<V>
-
syncUninterruptibly
从接口复制的说明:ListenableFutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.- 指定者:
syncUninterruptibly在接口中ListenableFuture<V>- 覆盖:
syncUninterruptibly在类中CompleteFuture<V>
-
getNow
从接口复制的说明:ListenableFutureReturn the result without blocking. If the future is not done yet this will returnnull.As it is possible that a
nullvalue is used to mark the future as successful you also need to check if the future is really done withFuture.isDone()and not rely on the returnednullvalue. -
obtain
从接口复制的说明:ListenableFutureReturn the result without blocking.must invoke after
ListenableFuture.isSuccess()- 指定者:
obtain在接口中ListenableFuture<V>- 覆盖:
obtain在类中AbstractFuture<V>- 抛出:
IllegalStateException-SettableFuture.setSuccess(Object)is setnull- 另请参阅:
-