Dashboard > Quartz 1 > Quartz 1 > QuartzSpringIntegration
  Quartz 1 Log In View a printable version of the current page.  
  QuartzSpringIntegration
Added by Jasper Rosenberg, last edited by Jasper Rosenberg on Sep 16, 2006  (view change)
Labels: 
(None)

Quartz-Spring Integration

 The Spring team has done a fantastic job of integrating Quartz into their framework, and it has become a popular way to add Quartz to a project.

Spring's Documentation

I would highly recommend checking out the APIs as well as the Spring documentation because there are several handy classes and properties not mentioned in the documentation.

Spring 1.2.x

Spring 2.0.x

Tips

SchedulerFactoryBean's applicationContextSchedulerContextKey property

One often overlooked property of the Spring SchedulerFactoryBean is applicationContextSchedulerContextKey.  Set this property to a name such as "applicationContext" and Spring will put your ApplicationContext into the Scheduler's SchedulerContext under than name.  This is very handy for cases where you would like your Jobs to have access to the ApplicationContext to make use of other Spring beans.

For example:

public class MyJob implements Job {
    public void execute(JobExecutionContext jobContext) throws JobExecutionException {
        ApplicationContext appContext =
            (ApplicationContext)jobContext.getScheduler().getSchedulerContext().get("applicationContext");
    }
}

 

 

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