类 DefaultProgressiveFuture<V>
java.lang.Object
cn.taketoday.util.concurrent.AbstractFuture<V>
cn.taketoday.util.concurrent.DefaultFuture<V>
cn.taketoday.util.concurrent.DefaultProgressiveFuture<V>
- 所有已实现的接口:
ListenableFuture<V>,ProgressiveFuture<V>,SettableFuture<V>,Future<V>
Default ProgressiveFuture
- 从以下版本开始:
- 4.0 2024/2/26 21:24
- 作者:
- Harry Yang
-
字段概要
从类继承的字段 cn.taketoday.util.concurrent.DefaultFuture
defaultExecutor -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明addListener(FutureListener<? extends ListenableFuture<V>> listener) Adds the specified listener to this future.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.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.setFailure(Throwable cause) Marks this future as a failure and notifies all listeners.setProgress(long progress, long total) Sets the current progress of the operation and notifies the listeners that implementProgressiveFutureListener.setSuccess(V result) Marks this future as a success and notifies all listeners.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.从类继承的方法 cn.taketoday.util.concurrent.DefaultFuture
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, get, get, getCause, getNow, interruptTask, isCancellable, isCancelled, isDone, isSuccess, notifyListener, notifyProgressiveListeners, setUncancellable, toString, toStringBuilder, tryFailure, trySuccess从类继承的方法 cn.taketoday.util.concurrent.AbstractFuture
obtain从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 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.ProgressiveFuture
addListener, onFailure, onSuccess从接口继承的方法 cn.taketoday.util.concurrent.SettableFuture
setUncancellable, tryFailure, trySuccess
-
构造器详细资料
-
DefaultProgressiveFuture
public DefaultProgressiveFuture()Creates a new instance. -
DefaultProgressiveFuture
Creates a new instance.- 参数:
executor- theExecutorwhich is used to notify the SettableFuture when it progresses or it is complete
-
-
方法详细资料
-
setProgress
从接口复制的说明:ProgressiveFutureSets the current progress of the operation and notifies the listeners that implementProgressiveFutureListener.- 指定者:
setProgress在接口中ProgressiveFuture<V>
-
tryProgress
public boolean tryProgress(long progress, long total) 从接口复制的说明:ProgressiveFutureTries 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.- 指定者:
tryProgress在接口中ProgressiveFuture<V>
-
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在接口中ProgressiveFuture<V>- 指定者:
addListener在接口中SettableFuture<V>- 覆盖:
addListener在类中DefaultFuture<V>
-
addListeners
public ProgressiveFuture<V> addListeners(FutureListener<? extends ListenableFuture<V>>... listeners) 从接口复制的说明: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在接口中ProgressiveFuture<V>- 指定者:
addListeners在接口中SettableFuture<V>- 覆盖:
addListeners在类中DefaultFuture<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在接口中ProgressiveFuture<V>- 指定者:
removeListener在接口中SettableFuture<V>- 覆盖:
removeListener在类中DefaultFuture<V>
-
removeListeners
public ProgressiveFuture<V> removeListeners(FutureListener<? extends ListenableFuture<V>>... listeners) 从接口复制的说明: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在接口中ProgressiveFuture<V>- 指定者:
removeListeners在接口中SettableFuture<V>- 覆盖:
removeListeners在类中DefaultFuture<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在接口中ProgressiveFuture<V>- 指定者:
sync在接口中SettableFuture<V>- 覆盖:
sync在类中DefaultFuture<V>- 抛出:
InterruptedException
-
syncUninterruptibly
从接口复制的说明:ListenableFutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.- 指定者:
syncUninterruptibly在接口中ListenableFuture<V>- 指定者:
syncUninterruptibly在接口中ProgressiveFuture<V>- 指定者:
syncUninterruptibly在接口中SettableFuture<V>- 覆盖:
syncUninterruptibly在类中DefaultFuture<V>
-
await
从接口复制的说明:ListenableFutureWaits for this future to be completed.- 指定者:
await在接口中ListenableFuture<V>- 指定者:
await在接口中ProgressiveFuture<V>- 指定者:
await在接口中SettableFuture<V>- 覆盖:
await在类中DefaultFuture<V>- 抛出:
InterruptedException- if the current thread was interrupted
-
awaitUninterruptibly
从接口复制的说明:ListenableFutureWaits for this future to be completed without interruption. This method catches anInterruptedExceptionand discards it silently.- 指定者:
awaitUninterruptibly在接口中ListenableFuture<V>- 指定者:
awaitUninterruptibly在接口中ProgressiveFuture<V>- 指定者:
awaitUninterruptibly在接口中SettableFuture<V>- 覆盖:
awaitUninterruptibly在类中DefaultFuture<V>
-
setSuccess
从接口复制的说明:SettableFutureMarks this future as a success and notifies all listeners. If it is success or failed already it will throw anIllegalStateException.- 指定者:
setSuccess在接口中SettableFuture<V>- 覆盖:
setSuccess在类中DefaultFuture<V>
-
setFailure
从接口复制的说明:SettableFutureMarks this future as a failure and notifies all listeners. If it is success or failed already it will throw anIllegalStateException.- 指定者:
setFailure在接口中SettableFuture<V>- 覆盖:
setFailure在类中DefaultFuture<V>
-