org.quartz.simpl.SimpleJobFactory Java Examples

The following examples show how to use org.quartz.simpl.SimpleJobFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SchedulerTest.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
protected Scheduler createScheduler(String name, int threadPoolSize) throws SchedulerException {
  try {
    this.taskSchedulerHelper = new TaskSchedulerHelper(database.getInstance());
    this.taskSchedulerHelper.init(threadPoolSize, new SimpleJobFactory());
    this.taskSchedulerHelper.start();
    return ((QuartzSchedulerSPI) taskSchedulerHelper.getScheduler()).getScheduler();
  }
  catch (Exception e) {
    Throwables.throwIfUnchecked(e);
    throw new RuntimeException(e);
  }
}
 
Example #2
Source File: AppConfig.java    From cloudbreak with Apache License 2.0 5 votes vote down vote up
@Bean
public SchedulerFactoryBean schedulerFactoryBean() {
    SchedulerFactoryBean scheduler = new SchedulerFactoryBean();
    scheduler.setTaskExecutor(getAsyncExecutor());
    scheduler.setAutoStartup(true);
    scheduler.setJobFactory(new SimpleJobFactory());
    return scheduler;
}