Hi All,
I have a Quartz SchedulerFactoryBean configured in my JavaConfig, when I have it defined as :
The Quartz threads do not start up.Code:@Bean(scope = DefaultScopes.SINGLETON, destroyMethodName="destroy") public SchedulerFactoryBean quartzScheduler() throws ParseException { SchedulerFactoryBean quartzScheduler = new SchedulerFactoryBean(); Trigger[] triggers = {EmailTrigger(), EscalationTrigger()}; quartzScheduler.setTriggers(triggers); quartzScheduler.setApplicationContextSchedulerContextKey("applicationContext"); Properties quartzProperties = new Properties(); quartzProperties.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool"); quartzProperties.put("org.quartz.threadPool.threadCount", "5"); quartzScheduler.setQuartzProperties(quartzProperties); return quartzScheduler; }
If I define it this way:
The quartz threads start but they do not shutdown when you stop Tomcat. I have tried with and without the destroyMethodName property.Code:@Bean(scope = DefaultScopes.SINGLETON, destroyMethodName="destroy") public Object quartzScheduler() throws ParseException { SchedulerFactoryBean quartzScheduler = new SchedulerFactoryBean(); Trigger[] triggers = {EmailTrigger(), EscalationTrigger()}; quartzScheduler.setTriggers(triggers); quartzScheduler.setApplicationContextSchedulerContextKey("applicationContext"); Properties quartzProperties = new Properties(); quartzProperties.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool"); quartzProperties.put("org.quartz.threadPool.threadCount", "5"); quartzScheduler.setQuartzProperties(quartzProperties); return this.getObject(quartzScheduler); }
Any help would be greatly appreciated.
Thanks,
Mike


