Class DynamicTask
java.lang.Object
io.github.lunasaw.sip.common.utils.DynamicTask
动态定时任务
- Author:
- lin
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
void
execute()
每五分钟检查失效的任务,并移除boolean
void
循环执行的任务void
void
startDelay
(String key, Runnable task, int delay) 延时任务boolean
-
Constructor Details
-
DynamicTask
public DynamicTask()
-
-
Method Details
-
DynamicTask
@PostConstruct public void DynamicTask() -
startCron
-
startCron
循环执行的任务- Parameters:
key
- 任务IDtask
- 任务time
- 间隔 毫秒
-
startDelay
延时任务- Parameters:
key
- 任务IDtask
- 任务delay
- 延时 /毫秒
-
stop
-
contains
-
getAllKeys
-
get
-
execute
@Scheduled(cron="0 0/5 * * * ?") public void execute()每五分钟检查失效的任务,并移除 -
isAlive
-