我有以下字段:
@Reference
private Scheduler scheduler;
来自包Scheduler
的 org.apache.sling.commons.scheduler
我有Runnable
职位:
protected Runnable job;
我运行安排:
scheduler.schedule(this.job, this.scheduleOptions);
如果在工作中发生错误,我想停止安排
public void run() {
if(checkThatSomethingWrong()){
//stop job
}
}