SchedulerListeners 與TriggerListeners和JobListeners很像,除了它是監聽調度器自己的時間通知的——不跟特定的觸發器或任務相關的事件。java
調度器相關的時間包括:任務/觸發器的添加和移除,調度器的嚴重錯誤,調度器被關閉的通知等等。spa
public interface SchedulerListener { public void jobScheduled(Trigger trigger); public void jobUnscheduled(String triggerName, String triggerGroup); public void triggerFinalized(Trigger trigger); public void triggersPaused(String triggerName, String triggerGroup); public void triggersResumed(String triggerName, String triggerGroup); public void jobsPaused(String jobName, String jobGroup); public void jobsResumed(String jobName, String jobGroup); public void schedulerError(String msg, SchedulerException cause); public void schedulerStarted(); public void schedulerInStandbyMode(); public void schedulerShutdown(); public void schedulingDataCleared(); }
SchedulerListeners向調度器的ListenerManager註冊。SchedulerListeners實際上能夠是任何實現org.quartz.SchedulerListener接口的對象。code
scheduler.getListenerManager().addSchedulerListener(mySchedListener);
scheduler.getListenerManager().removeSchedulerListener(mySchedListener);