use of org.motechproject.scheduler.exception.SchedulerInstantiationException in project motech by motech.
the class MotechSchedulerFactoryBean method init.
/**
* Creates the Spring {@code SchedulerFactoryBean}.
*/
@PostConstruct
public void init() {
schedulerFactoryBean = new SchedulerFactoryBean();
schedulerFactoryBean.setQuartzProperties(schedulerProperties);
schedulerFactoryBean.setWaitForJobsToCompleteOnShutdown(getBooleanWithDefault(schedulerProperties.getProperty("scheduler.waitForJobsToCompleteOnShutdown"), true));
schedulerFactoryBean.setApplicationContextSchedulerContextKey("applicationContext");
schedulerFactoryBean.setApplicationContext(applicationContext);
try {
schedulerFactoryBean.afterPropertiesSet();
schedulerFactoryBean.getScheduler().start();
} catch (Exception e) {
throw new SchedulerInstantiationException("Failed to instantiate scheduler with configuration from quartz.properties", e);
}
}
Aggregations