Quartz scheduler components
Quartz job is used for the logic or code which you want to execute. It implements org.quartz.Job interface.
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.
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:
- a. Seconds
- b. Minutes
- c. Hours
- d. Day-of-Month
- e. Month
- f. Day-of-Week
- g. Year (optional field)
3. Scheduler class – Scheduler class is used to connect the quartz job and quartz trigger together and execute the job.
Next Topic: Quartz 1.6 example using SimpleTrigger with example.
Previous Topic: Quartz scheduler.