@Order(value=-2147483647) public class TaskManager extends Object implements org.springframework.boot.ApplicationRunner
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
FIXED_DELAY |
static String |
FIXED_RATE |
| 构造器和说明 |
|---|
TaskManager(org.springframework.context.ApplicationContext applicationContext,
TaskService taskService,
TaskProxy taskProxy) |
| 限定符和类型 | 方法和说明 |
|---|---|
static Method |
getApi(String generic)
获取方法缓存
|
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 taskService,
TaskProxy taskProxy)
public void run(org.springframework.boot.ApplicationArguments args)
run 在接口中 org.springframework.boot.ApplicationRunnerpublic static Method getApi(String generic) throws NoSuchMethodException
generic - 根据方法的toGenericString检索NoSuchMethodExceptionpublic 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 © 2022. All rights reserved.