properties.put(StdSchedulerFactory.PROP_THREAD_POOL_CLASS, SystemInstance.get().hasProperty(QUARTZ_THREAD_POOL_ADAPTER) ? SystemInstance.get().getProperty(QUARTZ_THREAD_POOL_ADAPTER)
: DefaultTimerThreadPoolAdapter.class.getName());
properties.put(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME, "OpenEJB-TimerService-Scheduler");
try {
scheduler = new StdSchedulerFactory(properties).getScheduler();
scheduler.start();
//durability is configured with true, which means that the job will be kept in the store even if no trigger is attached to it.
//Currently, all the EJB beans share with the same job instance
scheduler.addJob(new JobDetail(OPENEJB_TIMEOUT_JOB_NAME, OPENEJB_TIMEOUT_JOB_GROUP_NAME, EjbTimeoutJob.class, false, true, false), true);
} catch (SchedulerException e) {
throw new RuntimeException("Fail to initialize the default scheduler", e);