本文整理汇总了Java中org.quartz.spi.JobFactory类的典型用法代码示例。如果您正苦于以下问题:Java JobFactory类的具体用法?Java JobFactory怎么用?Java JobFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JobFactory类属于org.quartz.spi包,在下文中一共展示了JobFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: schedulerFactory
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Bean
public SchedulerFactoryBean schedulerFactory(JobFactory jobFactory) {
SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean();
schedulerFactoryBean.setApplicationContext(applicationContext);
schedulerFactoryBean.setAutoStartup(schedulerProperties.isAutoStartup());
schedulerFactoryBean.setDataSource(dataSource);
schedulerFactoryBean.setTransactionManager(platformTransactionManager);
schedulerFactoryBean.setOverwriteExistingJobs(schedulerProperties.isOverwriteExistingJobs());
schedulerFactoryBean.setSchedulerFactoryClass(StdSchedulerFactory.class);
schedulerFactoryBean.setBeanName(schedulerProperties.getBeanName());
schedulerFactoryBean.setJobFactory(jobFactory);
schedulerFactoryBean.setWaitForJobsToCompleteOnShutdown(schedulerProperties.isWaitOnShutdown());
schedulerFactoryBean.setQuartzProperties(schedulerProperties.getProperties());
schedulerFactoryBean.setStartupDelay(schedulerProperties.getStartupDelay());
schedulerFactoryBean.setCalendars(calendarMap);
schedulerFactoryBean.setSchedulerListeners(schedulerListeners);
return schedulerFactoryBean;
}
示例2: schedulerFactoryBean
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Bean(name = "batch")
public SchedulerFactoryBean schedulerFactoryBean(
DataSource dataSource,
JobFactory jobFactory) {
SchedulerFactoryBean factory = new SchedulerFactoryBean();
factory.setOverwriteExistingJobs(true);
factory.setDataSource(dataSource);
factory.setJobFactory(jobFactory);
Properties props = new Properties();
props.setProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME, "batch");
props.setProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_ID, "auto");
props.setProperty("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.HSQLDBDelegate");
props.setProperty("org.quartz.scheduler.skipUpdateCheck", "true");
// factory.setQuartzProperties(props);
// factory.setTriggers(sampleJobTrigger);
return factory;
}
示例3: schedulerFactoryBean
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Bean
public SchedulerFactoryBean schedulerFactoryBean(
DataSource dataSource, PlatformTransactionManager transactionManager, JobFactory jobFactory) {
final SchedulerFactoryBean factory = new SchedulerFactoryBean();
factory.setOverwriteExistingJobs(true);
factory.setTaskExecutor(commonTaskScheduler.getScheduledExecutor());
factory.setDataSource(dataSource);
factory.setTransactionManager(transactionManager);
factory.setJobFactory(jobFactory);
factory.setQuartzProperties(quartzProperties);
factory.setSchedulerName(SCHEDULER_NAME);
factory.setAutoStartup(true);
factory.setWaitForJobsToCompleteOnShutdown(true);
// Delay added to avoid errors caused by updating registered tasks and reduce load on startup
factory.setStartupDelay(30);
return factory;
}
示例4: schedulerFactory
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Bean
public SchedulerFactoryBean schedulerFactory(JobFactory jobFactory) throws IOException {
SchedulerFactoryBean factory = new SchedulerFactoryBean();
factory.setSchedulerName("Sentry");
factory.setJobFactory(jobFactory);
factory.setQuartzProperties(quartzProperties());
// this allows to update triggers in DB when updating settings in config file:
factory.setOverwriteExistingJobs(true);
return factory;
}
示例5: QuartzSchedulerSPI
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Inject
public QuartzSchedulerSPI(final EventManager eventManager,
final NodeAccess nodeAccess,
final Provider<JobStore> jobStoreProvider,
final JobFactory jobFactory,
@Named("${nexus.quartz.poolSize:-20}") final int threadPoolSize)
throws Exception
{
this.eventManager = checkNotNull(eventManager);
this.nodeAccess = checkNotNull(nodeAccess);
this.jobStoreProvider = checkNotNull(jobStoreProvider);
this.jobFactory = checkNotNull(jobFactory);
checkArgument(threadPoolSize > 0, "Invalid thread-pool size: %s", threadPoolSize);
this.threadPoolSize = threadPoolSize;
log.info("Thread-pool size: {}", threadPoolSize);
this.scheduleFactory = new QuartzScheduleFactory();
this.triggerConverter = new QuartzTriggerConverter(this.scheduleFactory);
// FIXME: sort out with refinement to lifecycle below
this.active = true;
}
示例6: schedulerFactoryBean
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Bean
public SchedulerFactoryBean schedulerFactoryBean(ApplicationContext applicationContext, DataSource dataSource,
JobFactory jobFactory)
{
SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean();
schedulerFactory.setConfigLocation(new ClassPathResource("quartz.properties"));
schedulerFactory.setAutoStartup(true);
schedulerFactory.setDataSource(dataSource);
schedulerFactory.setJobFactory(jobFactory);
return schedulerFactory;
}
示例7: autoJobFactory
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Bean(name = QUARTZ_JOB_FACTORY_BEAN_NAME)
@ConditionalOnMissingBean(name = QUARTZ_JOB_FACTORY_BEAN_NAME)
public JobFactory autoJobFactory(ApplicationContext applicationContext) {
AutowiringSpringBeanJobFactory jobFactory = new AutowiringSpringBeanJobFactory();
jobFactory.setApplicationContext(applicationContext);
return jobFactory;
}
开发者ID:andrehertwig,项目名称:spring-boot-starter-quartz,代码行数:8,代码来源:QuartzSchedulerAutoConfiguration.java
示例8: configure
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Override
protected void configure() {
bind(MentorEventBus.class);
bind(JobFactory.class).to(GuiceJobFactory.class);
bind(Garbageman.class);
bind(MentorStatus.class);
}
示例9: provideScheduler
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Provides
@Singleton
Scheduler provideScheduler(JobFactory jobFactory) throws SchedulerException {
Scheduler scheduler = new StdSchedulerFactory("quartz.properties").getScheduler();
scheduler.setJobFactory(jobFactory);
return scheduler;
}
示例10: getInitialJobFactory
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Override
public JobFactory getInitialJobFactory() {
if (ipojoJobFactory == null) {
ipojoJobFactory = new IPOJOJobFactory();
}
return ipojoJobFactory;
}
示例11: configure
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Override
protected void configure() {
bind(Config.class).toInstance(new Config());
bind(JobFactory.class).to(SchedulerFactory.class);
bind(Cache.class).toProvider(CacheProvider.class);
bind(MangooTemplateEngine.class).toProvider(TemplateEngineProvider.class);
}
示例12: testBindings
import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Test
public void testBindings() {
//given
Injector guice = Application.getInjector();
//when
Binding<Stage> stage = guice.getBinding(Stage.class);
Binding<Injector> injector = guice.getBinding(Injector.class);
Binding<Logger> logger = guice.getBinding(Logger.class);
Binding<Config> config = guice.getBinding(Config.class);
Binding<JobFactory> jobFactory = guice.getBinding(JobFactory.class);
Binding<Cache> cache = guice.getBinding(Cache.class);
Binding<MangooTemplateEngine> mangooTemplateEngine = guice.getBinding(MangooTemplateEngine.class);
Binding<MangooRequestFilter> mangooRequestFilter = guice.getBinding(MangooRequestFilter.class);
Binding<MangooLifecycle> mangooLifecycle = guice.getBinding(MangooLifecycle.class);
//then
assertThat(stage.getKey().getTypeLiteral().getType().getTypeName(), equalTo("com.google.inject.Stage"));
assertThat(injector.getKey().getTypeLiteral().getType().getTypeName(), equalTo("com.google.inject.Injector"));
assertThat(logger.getKey().getTypeLiteral().getType().getTypeName(), equalTo("java.util.logging.Logger"));
assertThat(config.getKey().getTypeLiteral().getType().getTypeName(), equalTo("io.mangoo.configuration.Config"));
assertThat(jobFactory.getKey().getTypeLiteral().getType().getTypeName(), equalTo("org.quartz.spi.JobFactory"));
assertThat(cache.getKey().getTypeLiteral().getType().getTypeName(), equalTo("io.mangoo.cache.Cache"));
assertThat(mangooTemplateEngine.getKey().getTypeLiteral().getType().getTypeName(), equalTo("io.mangoo.interfaces.MangooTemplateEngine"));
assertThat(mangooRequestFilter.getKey().getTypeLiteral().getType().getTypeName(), equalTo("io.mangoo.interfaces.MangooRequestFilter"));
assertThat(mangooLifecycle.getKey().getTypeLiteral().getType().getTypeName(), equalTo("io.mangoo.interfaces.MangooLifecycle"));
}
示例13: setJobFactory
import org.quartz.spi.JobFactory; //导入依赖的package包/类
/**
* @see org.quartz.Scheduler#setJobFactory(org.quartz.spi.JobFactory)
*/
public void setJobFactory(JobFactory factory) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
示例14: setJobFactory
import org.quartz.spi.JobFactory; //导入依赖的package包/类
/**
* @see org.quartz.Scheduler#setJobFactory(org.quartz.spi.JobFactory)
*/
public void setJobFactory(JobFactory factory) throws SchedulerException {
sched.setJobFactory(factory);
}
示例15: setJobFactory
import org.quartz.spi.JobFactory; //导入依赖的package包/类
/**
* @see org.quartz.Scheduler#setJobFactory(org.quartz.spi.JobFactory)
*/
public void setJobFactory(JobFactory factory) throws SchedulerException {
throw new SchedulerException(
"Operation not supported for remote schedulers.");
}