核心: QuartzSchedulerThread.run()中循環執行。每一次任務的執行過程都會建立實例JobRunShell。java
private Scheduler createScheduler() { Scheduler result; try { StdSchedulerFactory factory = new StdSchedulerFactory(); Properties prop = new Properties(); prop.put("org.quartz.threadPool.class", org.quartz.simpl.SimpleThreadPool.class.getName()); prop.put("org.quartz.threadPool.threadCount", "1"); prop.put("org.quartz.scheduler.instanceName", liteJobConfig.getJobName()); prop.put("org.quartz.jobStore.misfireThreshold", "1"); prop.put("org.quartz.plugin.shutdownhook.class", JobShutdownHookPlugin.class.getName()); prop.put("org.quartz.plugin.shutdownhook.cleanShutdown", Boolean.TRUE.toString()); factory.initialize(prop); result = factory.getScheduler(); } catch (final SchedulerException ex) { throw new JobSystemException(ex); } return result; }