• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Spring and Quartz integration

Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I want to use the Scheduler component of Spring (in particular the Quartz scheduler), I configured the class that extends QuartzJobBean and the CronTriggerBean and also the XML Spring config file but I don't know what to run in order to start the scheduler.
Any help?

Thank you.
Posts: 43011
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's move this to the Application Framework forum, where the Spring-savvy folks hang out.
Posts: 14507
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would need to configure a SchedulerFactoryBean, specifying the list of triggers that would be created by the factory, then create an ApplicationContext. When the ApplicationContext is created, the Quartz scheduler will be created and started.
Ranch Hand
Posts: 633
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as only quartz concern,
This three line of code you have to implement

String configFile = getServletContext().getRealPath("\\WEB-INF\\ddc-quartz.properties");//cfg.getInitParameter("config-file");
SchedulerFactory sf = new StdSchedulerFactory(configFile);
scheduler = sf.getScheduler();
JobDetail jobDetail = new JobDetail("QuARTZJOB",Scheduler.DEFAULT_GROUP,QuartZJob.class);
CronTrigger trigger = new CronTrigger("QUARTZJOBTrigger","QUARTZCollectionTriggerGroup");
scheduler.scheduleJob(jobDetail, trigger);

the above code you need to write in the servlet init method. The deploy the servlet when application starts. Mention your trigger in config parameter.

I have not worked with Spring, but I believe Quartz is indepened application. You just need to deploy the quartz servlet and mention triggers.
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!