You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package $ { domain } . frame . schedule ;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler ;
import org.springframework.util.Assert ;
import java.time.Duration ;
import java.util.concurrent.ScheduledFuture ;
/**
* 间隔重复任务, 任务A执行结束后, 间隔指定时间后开始执行B
* 倘若A未执行完, B一直处于等待状态
*
* @author wangbing
* @version 0.0.1
* @since 2020-01-01
*/
public abstract class RunDelayRepeatTask extends RunTask {
public abstract Duration interval ( ) ;
@Override
public ScheduledFuture < ? > schedule ( ThreadPoolTaskScheduler poolTaskScheduler ) {
Assert . notNull ( poolTaskScheduler , "ThreadPoolTaskScheduler must not be null" ) ;
return poolTaskScheduler . scheduleWithFixedDelay ( this , interval ( ) ) ;
}
}