Quartz Scheduler Example Programs and Sample Code : Quartz Code Snippets : How-To: Instantiate a Scheduler
How-To: Instantiate a Scheduler
Instantiating the Default Scheduler
// the 'default' scheduler is defined in "quartz.properties" found
// in the current working directory, in the classpath, or
// resorts to a fall-back default that is in the quartz.jar
SchedulerFactory sf = new StdSchedulerFactory();
Scheduler scheduler = sf.getScheduler();
// Scheduler will not execute jobs until it has been started (though they
// can be scheduled before start())
scheduler.start();
Instantiating Specific Scheduler from Specific Properties
StdSchedulerFactory sf = new StdSchedulerFactory();
sf.initialize(schedulerProperties);
Scheduler scheduler = sf.getScheduler();
// Scheduler will not execute jobs until it has been started (though they
// can be scheduled before start())
scheduler.start();
Instantiating aSpecific Scheduler from a Specific Property File
StdSchedulerFactory sf = new StdSchedulerFactory();
sf.initialize(fileName);
Scheduler scheduler = sf.getScheduler();
// Scheduler will not execute jobs until it has been started (though they
// can be scheduled before start())
scheduler.start();
Copyright © 2010-2016 Software AG, Darmstadt, Germany.

Product Logo |   Feedback