http://www.quartz-scheduler.org/documentation/quartz-2.x/cookbook/SchedulerListeners.html
org.quartz.core.QuartzScheduler.pauseJob(JobKey)
public void pauseJob(JobKey jobKey) throws SchedulerException {
validateState();
resources.getJobStore().pauseJob(jobKey);
notifySchedulerThread(0L);
notifySchedulerListenersPausedJob(jobKey);
}
org.quartz.core.QuartzScheduler.pauseJob(JobKey)
public void pauseJob(JobKey jobKey) throws SchedulerException {
validateState();
resources.getJobStore().pauseJob(jobKey);
notifySchedulerThread(0L);
notifySchedulerListenersPausedJob(jobKey);
}
scheduler.getListenerManager().addSchedulerListener(mySchedListener);
public class MyOtherSchedulerListener extends SchedulerListenerSupport {
@Override
public void schedulerStarted() {
// do something with the event
}
@Override
public void schedulerShutdown() {
// do something with the event
}
@Override
public void jobScheduled(Trigger trigger) {
// do something with the event
}
}
https://www.mkyong.com/java/quartz-joblistener-example/public class HelloJob implements Job
{
public void execute(JobExecutionContext context)
throws JobExecutionException {
System.out.println("Hello Quartz! 123");
//Throw exception for testing
throw new JobExecutionException("Testing Exception");
}
}