接口 ProgressiveFuture<V>
- 所有超级接口:
Future<V>,ListenableFuture<V>,SettableFuture<V>
- 所有已知实现类:
DefaultProgressiveFuture
A
SettableFuture which is used to indicate the progress of an operation.- 从以下版本开始:
- 4.0 2024/2/26 20:48
- 作者:
- Harry Yang
- 另请参阅:
-
方法概要
修饰符和类型方法说明addListener(FutureListener<? extends ListenableFuture<V>> listener) Adds the specified listener to this future.default ProgressiveFuture<V>addListener(SuccessCallback<V> successCallback, FailureCallback failureCallback) Java 8 lambda-friendly alternative with success and failure callbacks.addListeners(FutureListener<? extends ListenableFuture<V>>... listeners) Adds the specified listeners to this future.await()Waits for this future to be completed.Waits for this future to be completed without interruption.default ProgressiveFuture<V>onFailure(FailureCallback failureCallback) Java 8 lambda-friendly alternative with failure callbacks.default ProgressiveFuture<V>onSuccess(SuccessCallback<V> successCallback) Java 8 lambda-friendly alternative with success callbacks.removeListener(FutureListener<? extends ListenableFuture<V>> listener) Removes the first occurrence of the specified listener from this future.removeListeners(FutureListener<? extends ListenableFuture<V>>... listeners) Removes the first occurrence for each of the listeners from this future.setProgress(long progress, long total) Sets the current progress of the operation and notifies the listeners that implementProgressiveFutureListener.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.booleantryProgress(long progress, long total) Tries to set the current progress of the operation and notifies the listeners that implementProgressiveFutureListener.从接口继承的方法 java.util.concurrent.Future
get, get, isCancelled, isDone从接口继承的方法 cn.taketoday.util.concurrent.ListenableFuture
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, completable, getCause, getNow, isCancellable, isSuccess, obtain从接口继承的方法 cn.taketoday.util.concurrent.SettableFuture
setFailure, setSuccess, setUncancellable, tryFailure, trySuccess
-
方法详细资料
-
setProgress
Sets the current progress of the operation and notifies the listeners that implementProgressiveFutureListener. -
tryProgress
boolean tryProgress(long progress, long total) Tries to set the current progress of the operation and notifies the listeners that implementProgressiveFutureListener. If the operation is already complete or the progress is out of range, this method does nothing but returningfalse. -
addListener
default ProgressiveFuture<V> addListener(SuccessCallback<V> successCallback, @Nullable FailureCallback failureCallback) 从接口复制的说明:ListenableFutureJava 8 lambda-friendly alternative with success and failure callbacks.- 指定者:
addListener在接口中ListenableFuture<V>- 指定者:
addListener在接口中SettableFuture<V>- 参数:
successCallback- the success callbackfailureCallback- the failure callback
-
onSuccess
从接口复制的说明:ListenableFutureJava 8 lambda-friendly alternative with success callbacks.- 指定者:
onSuccess在接口中ListenableFuture<V>- 指定者:
onSuccess在接口中SettableFuture<V>- 参数:
successCallback- the success callback
-
onFailure
从接口复制的说明:ListenableFutureJava 8 lambda-friendly alternative with failure callbacks.- 指定者:
onFailure在接口中ListenableFuture<V>- 指定者:
onFailure在接口中SettableFuture<V>- 参数:
failureCallback- the failure callback
-
addListener
从接口复制的说明:ListenableFutureAdds the specified listener to this future.The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.
- 指定者:
addListener在接口中ListenableFuture<V>- 指定者:
addListener在接口中SettableFuture<V>
-
addListeners
从接口复制的说明:ListenableFutureAdds the specified listeners to this future.The specified listeners are notified when this future is done. If this future is already completed, the specified listeners are notified immediately.
- 指定者:
addListeners在接口中ListenableFuture<V>- 指定者:
addListeners在接口中SettableFuture<V>
-
removeListener
从接口复制的说明:ListenableFutureRemoves the first occurrence of the specified listener from this future.The specified listener is no longer notified when this future is done. If the specified listener is not associated with this future, this method does nothing and returns silently.
- 指定者:
removeListener在接口中ListenableFuture<V>- 指定者:
removeListener在接口中SettableFuture<V>
-
removeListeners
从接口复制的说明:ListenableFutureRemoves the first occurrence for each of the listeners from this future.The specified listeners are no longer notified when this future is done. If the specified listeners are not associated with this future, this method does nothing and returns silently.
- 指定者:
removeListeners在接口中ListenableFuture<V>- 指定者:
removeListeners在接口中SettableFuture<V>
-
sync
从接口复制的说明:ListenableFutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.- 指定者:
sync在接口中ListenableFuture<V>- 指定者:
sync在接口中SettableFuture<V>- 抛出:
InterruptedException
-
syncUninterruptibly
ProgressiveFuture<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在接口中SettableFuture<V>
-
await
从接口复制的说明:ListenableFutureWaits for this future to be completed.- 指定者:
await在接口中ListenableFuture<V>- 指定者:
await在接口中SettableFuture<V>- 抛出:
InterruptedException- if the current thread was interrupted
-
awaitUninterruptibly
ProgressiveFuture<V> awaitUninterruptibly()从接口复制的说明:ListenableFutureWaits for this future to be completed without interruption. This method catches anInterruptedExceptionand discards it silently.- 指定者:
awaitUninterruptibly在接口中ListenableFuture<V>- 指定者:
awaitUninterruptibly在接口中SettableFuture<V>
-