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.
19 lines
611 B
19 lines
611 B
package ${domain}.frame.schedule;
|
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
|
import org.springframework.scheduling.support.CronTrigger;
|
|
import org.springframework.util.Assert;
|
|
|
|
import java.util.concurrent.ScheduledFuture;
|
|
|
|
public abstract class RunCronTask extends RunTask {
|
|
|
|
public abstract String cron();
|
|
|
|
@Override
|
|
public ScheduledFuture<?> schedule(ThreadPoolTaskScheduler poolTaskScheduler) {
|
|
Assert.notNull(poolTaskScheduler, "ThreadPoolTaskScheduler must not be null");
|
|
return poolTaskScheduler.schedule(this, new CronTrigger(cron()));
|
|
}
|
|
}
|