final ThreadPoolManager tpm = this.threadPoolManager;
if ( tpm == null ) {
final SchedulerFactory factory = new StdSchedulerFactory();
this.scheduler = factory.getScheduler();
} else {
final ThreadPool pool = tpm.get(THREAD_POOL_NAME);
final QuartzThreadPool quartzPool = new QuartzThreadPool(pool);
final DirectSchedulerFactory factory = DirectSchedulerFactory.getInstance();
factory.createScheduler(quartzPool, new RAMJobStore());
this.scheduler = factory.getScheduler();
}