Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between scheduler's standby() and pauseAll()?

I'm using Quartz Scheduler v.1.8.0.

What's the difference between scheduler.standby() and scheduler.pauseAll()?

standby() - Temporarily halts the Scheduler's firing of Triggers.

pauseAll() - Pause all triggers - similar to calling pauseTriggerGroup(group) on every group, however, after using this method resumeAll() must be called to clear the scheduler's state of 'remembering' that all new triggers will be paused as they are added.

Based on what I've understood from the API documentation, I'm not able to easily/clearly differentiate/distinguish from each one of them. I'm seeing both of them serving the same purpose - temporarily pause/halt all the triggers in the scheduler, and subsequently followed by a start() (for standby) or resumeAll() (for pauseAll) to clear the scheduler's state. Is there any other difference?

Hope experts can help me in understanding any subtle difference.

like image 713
Gnanam Avatar asked Sep 06 '10 09:09

Gnanam


People also ask

How do you reschedule a quartz job?

rescheduleJob. Remove (delete) the Trigger with the given key, and store the new given one - which must be associated with the same job (the new trigger must have the job name & group specified) - however, the new trigger need not have the same name as the old trigger. newTrigger - The new Trigger to be stored.

How do you pause a job in quartz Scheduler?

Pause all of the JobDetail s in the matching groups - by pausing all of their Trigger s. Pause the Trigger with the given name. Pause all of the Trigger s in the matching groups. Remove the identified JobListener from the Scheduler 's list of internal listeners.

How do I stop a quartz Scheduler in Java?

2.2 Unschedule Job We can unschedule a Job by calling the unschedule() method of the Scheduler class and passing the TriggerKey . If the related job does not have any other triggers, and the job is not durable, then the job will also be deleted.


2 Answers

The difference is in trigger misfire instructions applying behavior.

When you call start() after standby(), any misfires, which appear while standby, will be ignored.

When you call resumeAll() after pauseAll(), all misfires, which appear while scheduler was paused, will be applyed.

like image 147
dchekmarev Avatar answered Oct 04 '22 04:10

dchekmarev


There is difference when scheduler is resumed after standby and pauseAll.

I have made difference in bold in following description from API docs.

standby :

void standby() throws SchedulerException Temporarily halts the Scheduler's firing of Triggers.

When start() is called (to bring the scheduler out of stand-by mode), trigger misfire instructions will NOT be applied during the execution of the start() method - any misfires will be detected immediately afterward (by the JobStore's normal process).

The scheduler is not destroyed, and can be re-started at any time.

pauseAll :

void pauseAll() throws SchedulerException Pause all triggers - similar to calling pauseTriggerGroup(group) on every group, however, after using this method resumeAll() must be called to clear the scheduler's state of 'remembering' that all new triggers will be paused as they are added.

When resumeAll() is called (to un-pause), trigger misfire instructions WILL be applied.

like image 39
YoK Avatar answered Oct 04 '22 04:10

YoK