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


Java JobDetailFactoryBean.setDurability方法代码示例

本文整理汇总了Java中org.springframework.scheduling.quartz.JobDetailFactoryBean.setDurability方法的典型用法代码示例。如果您正苦于以下问题:Java JobDetailFactoryBean.setDurability方法的具体用法?Java JobDetailFactoryBean.setDurability怎么用?Java JobDetailFactoryBean.setDurability使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.scheduling.quartz.JobDetailFactoryBean的用法示例。


在下文中一共展示了JobDetailFactoryBean.setDurability方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createJob

import org.springframework.scheduling.quartz.JobDetailFactoryBean; //导入方法依赖的package包/类
/**
 * Create Quartz Job.
 * 
 * @param jobClass Class whose executeInternal() method needs to be called. 
 * @param isDurable Job needs to be persisted even after completion. if true, job will be persisted, not otherwise. 
 * @param context Spring application context.
 * @param jobName Job name.
 * @param jobGroup Job group.
 * 
 * @return JobDetail object
 */
protected static JobDetail createJob(Class<? extends QuartzJobBean> jobClass, boolean isDurable, 
		ApplicationContext context, String jobName, String jobGroup){
    JobDetailFactoryBean factoryBean = new JobDetailFactoryBean();
    factoryBean.setJobClass(jobClass);
    factoryBean.setDurability(isDurable);
    factoryBean.setApplicationContext(context);
    factoryBean.setName(jobName);
    factoryBean.setGroup(jobGroup);
       
    // set job data map
       JobDataMap jobDataMap = new JobDataMap();
       jobDataMap.put("myKey", "myValue");
       factoryBean.setJobDataMap(jobDataMap);
       
       factoryBean.afterPropertiesSet();
       
    return factoryBean.getObject();
}
 
开发者ID:javabypatel,项目名称:spring-boot-quartz-demo,代码行数:30,代码来源:JobUtil.java

示例2: jobDetailFactoryBean

import org.springframework.scheduling.quartz.JobDetailFactoryBean; //导入方法依赖的package包/类
@Bean(name = "cleanUpJobDetail")
public JobDetailFactoryBean jobDetailFactoryBean() {
    JobDetailFactoryBean factory = new JobDetailFactoryBean();
    factory.setJobClass(CleanUpJob.class);
    factory.setDurability(true);
    return factory;
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:8,代码来源:QuartzAppContext.java

示例3: createJobDetail

import org.springframework.scheduling.quartz.JobDetailFactoryBean; //导入方法依赖的package包/类
private JobDetailFactoryBean createJobDetail(String name, Class<?> jobClass) {
	JobDetailFactoryBean factoryBean = new JobDetailFactoryBean();
	factoryBean.setName(name);
	factoryBean.setJobClass(jobClass);
	factoryBean.setApplicationContext(context);
	factoryBean.setApplicationContextJobDataKey(AbstractJob.KEY_APPLICATION_CONTEXT);
	// job has to be durable to be stored in DB:
	factoryBean.setDurability(true);
	factoryBean.afterPropertiesSet();
	return factoryBean;
}
 
开发者ID:mazhaoyong,项目名称:api-server-seed,代码行数:12,代码来源:QuartzFactory.java

示例4: gravatarJob

import org.springframework.scheduling.quartz.JobDetailFactoryBean; //导入方法依赖的package包/类
@Bean
public JobDetailFactoryBean gravatarJob() {
	JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean();
	jobDetailFactory.setJobClass(GravatarJob.class);
	jobDetailFactory.setGroup("lemonaid-quartz");
	jobDetailFactory.setDurability(true);
	return jobDetailFactory;
}
 
开发者ID:sapmentors,项目名称:lemonaid,代码行数:9,代码来源:QuartzConfig.java

示例5: locationJob

import org.springframework.scheduling.quartz.JobDetailFactoryBean; //导入方法依赖的package包/类
@Bean
public JobDetailFactoryBean locationJob() {
	JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean();
	jobDetailFactory.setJobClass(LocationJob.class);
	jobDetailFactory.setGroup("lemonaid-quartz");
	jobDetailFactory.setDurability(true);
	return jobDetailFactory;
}
 
开发者ID:sapmentors,项目名称:lemonaid,代码行数:9,代码来源:QuartzConfig.java

示例6: insideTrackJob

import org.springframework.scheduling.quartz.JobDetailFactoryBean; //导入方法依赖的package包/类
@Bean
public JobDetailFactoryBean insideTrackJob() {
	JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean();
	jobDetailFactory.setJobClass(InsideTrackJob.class);
	jobDetailFactory.setGroup("lemonaid-quartz");
	jobDetailFactory.setDurability(true);
	return jobDetailFactory;
}
 
开发者ID:sapmentors,项目名称:lemonaid,代码行数:9,代码来源:QuartzConfig.java


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