Dashboard > Quartz 1 > ... > Documentation > CreateScheduler
  Quartz 1 Log In View a printable version of the current page.  
  CreateScheduler
Added by James House, last edited by Nicolas Raoul on Apr 25, 2008  (view change) show comment
Labels: 
(None)

Instantiating 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 A 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 A Specific 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();

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators