正式初始化QuartzScheduler
调度器接口及实现如下
Scheduler
StdScheduler 默认的调度器,其实就是QuartzScheduler类的包装。
QuartzScheduler 核心类
ExecutingJobsManagerjobMgr=null;
ErrorLoggererrLogger=null;
privateSchedulerSignalersignaler;
1.构造方法
public QuartzScheduler(QuartzSchedulerResources resources,longidleWaitTime,@Deprecated long dbRetryInterval)
throwsSchedulerException{
//配置资源
this.resources = resources;
if(resources.getJobStore() instanceof JobListener){
addInternalJobListener((JobListener)resources.getJobStore());
}
//构造调度线程...核心线程!!!
this.schedThread = new QuartzSchedulerThread(this,resources);
ThreadExecutor schedThreadExecutor = resources.getThreadExecutor();
schedThreadExecutor.execute(this.schedThread);
if(idleWaitTime>0){
this.schedThread.setIdleWaitTime(idleWaitTime);
}
jobMgr = new ExecutingJobsManager();
addInternalJobListener(jobMgr);
errLogger=newErrorLogger();
add InternalSchedulerListener(errLogger);
signaler = new SchedulerSignalerImpl(this,this.schedThread);
if(shouldRunUpdateCheck())
updateTimer=scheduleUpdateCheck();
else
updateTimer=null;
getLog().info("QuartzSchedulerv."+getVersion()+"created.");
}
初始化
bind 绑定rmi调用
registerJMX 注册JMX
网友评论