quartz的学习
- Scheduler - the main API for interacting with the scheduler.
- Job - an interface to be implemented by components that you wish to have executed by the scheduler.
- JobDetail - used to define instances of Jobs.
- Trigger - a component that defines the schedule upon which a given Job will be executed.
- JobBuilder - used to define/build JobDetail instances, which define instances of Jobs.
- TriggerBuilder - used to define/build Trigger instances.
- JobDataMap - 如何在两次执行之间跟踪作业的状态
- context.getJobDetail().getJobDataMap();
- context.getTrigger().getJobDataMap();
- context.getMergedJobDataMap(); 上述两个JobDataMap的合并,后者的值会覆盖前者的值。
- ScheduleBuilder
- Calendar
- TriggerListener
- JobListener - scheduler.getListenerManager().addJobListener(myJobListener, KeyMatcher.jobKeyEquals(new JobKey("myJobName", "myJobGroup")));
- SchedulerListener
- JobStore - RAMJobStore, JDBCJobStore, TerracottaJobStore。后两种支持集群
- SchedulerPlugin
- @DisallowConcurrentExecution
- @PersistJobDataAfterExecution
- Priority。- 当同一时刻,需要触发执行的job,多于工作线程时,优先级的优先执行。
- Misfire Instructions
显然JobDetail和Trigger和构建都是使用了建造者模式,可以看下源码看看quartz的建造者模式是怎么写的。