zhub-client/src/main/java/dev/zhub/timer/task/Task.java
2024-04-23 19:20:16 +08:00

71 lines
1.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package dev.zhub.timer.task;
import dev.zhub.timer.TimerExecutor;
import dev.zhub.timer.scheduled.Scheduled;
/**
* @author: liangxianyou at 2018/8/5 19:32.
*/
public interface Task extends Runnable {
/**
* 得到任务名称
*
* @return
*/
String getName();
/**
* 设置任务执行计划
*
* @param scheduled
*/
void setScheduled(Scheduled scheduled);
/**
* 得到下一次执行计划的时间并设置thenTime
*
* @return
*/
long nextTime();
/**
* 任务即将执行的时间点
*
* @return
*/
long theTime();
/**
* 是否完成
*
* @return
*/
boolean isComplete();
/**
* 完成任务(结束标记)
*
* @param complete
*/
void setComplete(boolean complete);
/**
* 开始时间(创建时间)
*
* @return
*/
long startTime();
TimerExecutor getTimerExecutor();
void setTimerExecutor(TimerExecutor timerExecutor);
/**
* 得到总执行次数
*
* @return
*/
int getExecCount();
}