Quartz scheduler components

Quartz job:

Quartz job is used for the logic or code which you want to execute. It implements org.quartz.Job interface.

Quartz trigger:

Quartz trigger is used to define the moment when the quartz scheduler will execute quartz’s job.

Types of quartz trigger:

1. SimpleTrigger – SimpleTrigger setting start time, end time, repeat count and repeat interval for quartz’s job.
SimpleTrigger’s Constructors:
public SimpleTrigger(String name, String group, Date startTime, Date endTime, int repeatCount, long repeatInterval)
2. CronTrigger – CronTrigger uses cron expressions to specify the moment when to execute quartz’s job. A cron expression is made up of seven sub expressions:
  1. a. Seconds
  2. b. Minutes
  3. c. Hours
  4. d. Day-of-Month
  5. e. Month
  6. f. Day-of-Week
  7. g. Year (optional field)
3. Scheduler class – Scheduler class is used to connect the quartz job and quartz trigger together and execute the job.
 

No comments: