public class TaskManager extends Object implements org.springframework.boot.ApplicationRunner
| 构造器和说明 |
|---|
TaskManager(org.springframework.context.ApplicationContext applicationContext,
TaskService taskManager,
TaskProxy taskProxy) |
| 限定符和类型 | 方法和说明 |
|---|---|
static Date |
nextExecutionTimeByTaskCode(Long taskCode)
获取任务下一次执行时间
|
void |
removeTask(Long taskCode)
删除定时任务
|
void |
removeTaskByMethod(Method method) |
static void |
reStart(Long taskCode)
启动定时任务
|
void |
run(org.springframework.boot.ApplicationArguments args)
spring容器初始化时初始化全部定时任务
|
void |
startTask(long taskCode) |
void |
stopTask(Long taskCode)
停止定时任务
|
void |
updateTask(Task task)
添加/更新定时任务
|
public TaskManager(org.springframework.context.ApplicationContext applicationContext,
TaskService taskManager,
TaskProxy taskProxy)
public void run(org.springframework.boot.ApplicationArguments args)
run 在接口中 org.springframework.boot.ApplicationRunnerpublic void updateTask(Task task) throws NotFoundTaskException, NoSuchMethodException
task - 定时任务信息NotFoundTaskExceptionNoSuchMethodExceptionpublic static Date nextExecutionTimeByTaskCode(Long taskCode)
taskCode - 定时任务标识public static void reStart(Long taskCode)
taskCode - 定时任务标识public void removeTask(Long taskCode) throws NotFoundTaskException
taskCode - 任务标识NotFoundTaskException - 没找到public void stopTask(Long taskCode) throws NotFoundTaskException
taskCode - 任务标识NotFoundTaskException - 没找到public void startTask(long taskCode)
throws NotFoundTaskException
public void removeTaskByMethod(Method method) throws NotFoundTaskException
Copyright © 2020. All rights reserved.