Example usage for org.springframework.scheduling.quartz SchedulerFactoryBean setConfigLocation

List of usage examples for org.springframework.scheduling.quartz SchedulerFactoryBean setConfigLocation

Introduction

In this page you can find the example usage for org.springframework.scheduling.quartz SchedulerFactoryBean setConfigLocation.

Prototype

public void setConfigLocation(Resource configLocation) 

Source Link

Document

Set the location of the Quartz properties config file, for example as classpath resource "classpath:quartz.properties".

Usage

From source file:nu.yona.server.batch.quartz.QuartzConfig.java

@Bean
public SchedulerFactoryBean schedulerFactoryBean(ApplicationContext applicationContext, DataSource dataSource,
        JobFactory jobFactory) {//w  ww.  j  a  v a  2  s  . c o  m
    SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean();
    schedulerFactory.setConfigLocation(new ClassPathResource("quartz.properties"));
    schedulerFactory.setAutoStartup(true);
    schedulerFactory.setDataSource(dataSource);
    schedulerFactory.setJobFactory(jobFactory);
    return schedulerFactory;
}

From source file:mg.jerytodik.scheduler.config.JeryTodikSchedulerConfig.java

@Bean
public SchedulerFactoryBean scheduler(final Trigger trigger, final JobDetail job) {

    SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean();
    schedulerFactory.setConfigLocation(new ClassPathResource("quartz.properties"));
    schedulerFactory.setJobFactory(springBeanJobFactory());
    schedulerFactory.setJobDetails(job);
    schedulerFactory.setTriggers(trigger);

    return schedulerFactory;
}