当前位置: 首页>>代码示例>>Java>>正文


Java JobFactory类代码示例

本文整理汇总了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;
}
 
开发者ID:hs-web,项目名称:hsweb-framework,代码行数:19,代码来源:ScheduleAutoConfiguration.java

示例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;
    }
 
开发者ID:mow811236,项目名称:sample-schedule-job-admin,代码行数:20,代码来源:Quartz.java

示例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;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:21,代码来源:QuartzConfig.java

示例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;
}
 
开发者ID:quanticc,项目名称:sentry,代码行数:11,代码来源:SchedulerConfiguration.java

示例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;
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:24,代码来源:QuartzSchedulerSPI.java

示例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;
}
 
开发者ID:yonadev,项目名称:yona-server,代码行数:12,代码来源:QuartzConfig.java

示例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);
}
 
开发者ID:vsite-hr,项目名称:mentor,代码行数:8,代码来源:MentorModule.java

示例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;
}
 
开发者ID:vsite-hr,项目名称:mentor,代码行数:8,代码来源:MentorModule.java

示例10: getInitialJobFactory

import org.quartz.spi.JobFactory; //导入依赖的package包/类
@Override
public JobFactory getInitialJobFactory() {
    if (ipojoJobFactory == null) {
        ipojoJobFactory = new IPOJOJobFactory();
    }
    return ipojoJobFactory;
}
 
开发者ID:andyphillips404,项目名称:awplab-core,代码行数:8,代码来源:VolatileSchedulerProvider.java

示例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);
}
 
开发者ID:svenkubiak,项目名称:mangooio,代码行数:8,代码来源:Module.java

示例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"));
	
}
 
开发者ID:svenkubiak,项目名称:mangooio,代码行数:29,代码来源:ModuleTest.java

示例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.");
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:RemoteMBeanScheduler.java

示例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);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:StdScheduler.java

示例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.");
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:RemoteScheduler.java


注:本文中的org.quartz.spi.JobFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。