Package org.qiunet.utils.timer
Enum Class TimerManager
- All Implemented Interfaces:
Serializable,Comparable<TimerManager>,Constable
Created by qiunet.
18/1/26
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> DFuture<V>executorNow(Runnable callable) 立刻执行static <V> DFuture<V>executorNow(Callable<V> callable) scheduleAtFixedRate(IScheduledTask timerTask, long delay, long period, TimeUnit unit) 默认使用毫秒<T> DFuture<T>scheduleWithDelay(Runnable delayTask, long delay, TimeUnit unit) 添加延迟处理任务.<T> DFuture<T>scheduleWithDelay(IDelayTask<T> delayTask, long delay, TimeUnit unit) <T> DFuture<T>scheduleWithTimeMillis(Runnable delayTask, long timeMillis) <T> DFuture<T>scheduleWithTimeMillis(IDelayTask<T> delayTask, long timeMillis) 在一个指定的时间点执行任务static TimerManagerReturns the enum constant of this class with the specified name.static TimerManager[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
instance
自定义的 ScheduledThreadPool 需要调时间有效的, 使用该实例 -
executor
系统自带的 ScheduledThreadPool
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
executorNow
立刻执行- Type Parameters:
V-- Parameters:
callable-- Returns:
-
executorNow
-
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(IScheduledTask timerTask, long delay, long period, TimeUnit unit) 默认使用毫秒- Parameters:
timerTask- 任务delay- 延时毫秒period- 调度周期
-
scheduleWithDelay
添加延迟处理任务.- Type Parameters:
T-- Parameters:
delayTask- 任务delay- 延迟参数unit- 时间格式
-
scheduleWithDelay
-
scheduleWithTimeMillis
-
scheduleWithTimeMillis
在一个指定的时间点执行任务- Type Parameters:
T-- Parameters:
delayTask-timeMillis-- Returns:
-