final JobStore jobStore = new RAMJobStore();
final ThreadPool threadPool = new SimpleThreadPool(100, Thread.NORM_PRIORITY);
try {
threadPool.initialize();
} catch (SchedulerConfigException ex) {
throw new CronProviderInitialisationException("Error initializing Quartz ThreadPool", ex);
}
final DirectSchedulerFactory schedulerFactory = DirectSchedulerFactory.getInstance();
schedulerName = SCHEDULER_NAME_PREFIX + "_" + instanceId.toString();
try {
schedulerFactory.createScheduler(schedulerName, instanceId.toString(), threadPool, jobStore);
scheduler = schedulerFactory.getScheduler(schedulerName);
scheduler.start();
} catch (SchedulerException ex) {
throw new CronProviderInitialisationException("Error initializing Quartz scheduler", ex);
}
}