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


Java CronTriggerFactoryBean.setCronExpression方法代码示例

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


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

示例1: initTransferJob

import org.springframework.scheduling.quartz.CronTriggerFactoryBean; //导入方法依赖的package包/类
public void initTransferJob(TransferJob transferJob) throws ClassNotFoundException, NoSuchMethodException, ParseException, SchedulerException {
	MethodInvokingJobDetailFactoryBean jobDetailFactory = new MethodInvokingJobDetailFactoryBean();
   	jobDetailFactory.setTargetObject(this);
   	jobDetailFactory.setTargetMethod("runReceiveJob");
   	jobDetailFactory.setConcurrent(false);
   	jobDetailFactory.setArguments(new Object[]{transferJob});
   	jobDetailFactory.setName(transferJob.getId() + "_job");
   	jobDetailFactory.afterPropertiesSet();
   	JobDetail jobDetail = jobDetailFactory.getObject();
   	
   	CronTriggerFactoryBean triggerFactory = new CronTriggerFactoryBean();
   	triggerFactory.setCronExpression(transferJob.getCronExpression());
   	triggerFactory.setName(transferJob.getName() + "_trigger");
   	triggerFactory.setJobDetail(jobDetail);
   	
   	triggerFactory.afterPropertiesSet();
   	scheduler.scheduleJob(jobDetail,triggerFactory.getObject());
   	LOGGER.debug("Transfer job: {}({}) initialized", transferJob.getName(),transferJob.getId());
}
 
开发者ID:northlander,项目名称:activemft,代码行数:20,代码来源:ReceiverService.java

示例2: afterPropertiesSet

import org.springframework.scheduling.quartz.CronTriggerFactoryBean; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet () throws Exception
{
   Map<String, AbstractJob> webappBeanNames =
      applicationContext.getBeansOfType (AbstractJob.class);
   triggers = new HashMap<> ();
   for (String webappBeanName : webappBeanNames.keySet ())
   {
      AbstractJob cron = webappBeanNames.get (webappBeanName);
      CronTriggerFactoryBean trigger = new CronTriggerFactoryBean ();
      JobDetail job = JobBuilder.newJob (cron.getClass ()).
         storeDurably (true).build ();
      trigger.setJobDetail (job);
      trigger.setCronExpression (cron.getCronExpression ());
      trigger.setName (webappBeanName + "Trigger");
      trigger.afterPropertiesSet ();
      triggers.put (cron.getClass(), trigger.getObject ());
   }
   super.setTriggers (triggers.values ().toArray (
      new Trigger[triggers.size ()]));
   super.setJobFactory (autowiringJobFactory);
   super.afterPropertiesSet ();
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:24,代码来源:JobScheduler.java

示例3: cronJobTrigger

import org.springframework.scheduling.quartz.CronTriggerFactoryBean; //导入方法依赖的package包/类
/** 
 * attention: 
 * Details:配置定时任务的触发器,也就是什么时候触发执行定时任务 
 */  
@Bean(name = "jobTrigger")  
public CronTriggerFactoryBean cronJobTrigger(MethodInvokingJobDetailFactoryBean jobDetail) {  
    CronTriggerFactoryBean tigger = new CronTriggerFactoryBean();  
    tigger.setJobDetail(jobDetail.getObject());  
    /*tigger.setCronExpression("0 30 20 * * ?");// 初始时的cron表达式   */        
    tigger.setCronExpression("59 39 17 * * ?"); //初始的时候cron表达式,每天的下午17:40:00准时调度
    tigger.setName("srd-chhliu");// trigger的name  
    return tigger;  
  
}
 
开发者ID:duanyaxin,项目名称:springboot-smart,代码行数:15,代码来源:QuartzConfigration.java

示例4: cronTriggerFactoryBean

import org.springframework.scheduling.quartz.CronTriggerFactoryBean; //导入方法依赖的package包/类
@Bean(name = "cleanUpCronTriggerFactoryBean")
public CronTriggerFactoryBean cronTriggerFactoryBean() {
    com.sap.cloud.lm.sl.cf.core.util.Configuration configuration = com.sap.cloud.lm.sl.cf.core.util.Configuration.getInstance();
    CronTriggerFactoryBean factory = new CronTriggerFactoryBean();
    factory.setJobDetail(jobDetailFactoryBean().getObject());
    factory.setCronExpression(configuration.getCronExpressionForOldData());
    factory.setGroup(TRIGGER_GROUP);
    factory.setName(CLEAN_UP_TRIGGER_NAME);
    return factory;
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:11,代码来源:QuartzAppContext.java

示例5: createCronTrigger

import org.springframework.scheduling.quartz.CronTriggerFactoryBean; //导入方法依赖的package包/类
private CronTriggerFactoryBean createCronTrigger(String name, JobDetail jobDetail, String corn)
		throws ParseException {
	CronTriggerFactoryBean factoryBean = new CronTriggerFactoryBean();
	factoryBean.setName(name);
	factoryBean.setJobDetail(jobDetail);
	factoryBean.setCronExpression(corn);
	factoryBean.afterPropertiesSet();
	return factoryBean;
}
 
开发者ID:mazhaoyong,项目名称:api-server-seed,代码行数:10,代码来源:QuartzFactory.java

示例6: gravatarTrigger

import org.springframework.scheduling.quartz.CronTriggerFactoryBean; //导入方法依赖的package包/类
@Bean
public CronTriggerFactoryBean gravatarTrigger() {
	CronTriggerFactoryBean cronTriggerFactoryBean = new CronTriggerFactoryBean();
	cronTriggerFactoryBean.setJobDetail(gravatarJob().getObject());
	cronTriggerFactoryBean.setCronExpression("0 30 * * * ?"); // Every hour
	cronTriggerFactoryBean.setGroup("lemonaid-quartz");
	return cronTriggerFactoryBean;
}
 
开发者ID:sapmentors,项目名称:lemonaid,代码行数:9,代码来源:QuartzConfig.java

示例7: locationTrigger

import org.springframework.scheduling.quartz.CronTriggerFactoryBean; //导入方法依赖的package包/类
@Bean
public CronTriggerFactoryBean locationTrigger() {
	CronTriggerFactoryBean cronTriggerFactoryBean = new CronTriggerFactoryBean();
	cronTriggerFactoryBean.setJobDetail(locationJob().getObject());
	cronTriggerFactoryBean.setCronExpression("0 15 0 * * ?"); // Every day
	cronTriggerFactoryBean.setGroup("lemonaid-quartz");
	return cronTriggerFactoryBean;
}
 
开发者ID:sapmentors,项目名称:lemonaid,代码行数:9,代码来源:QuartzConfig.java

示例8: insideTrackTrigger

import org.springframework.scheduling.quartz.CronTriggerFactoryBean; //导入方法依赖的package包/类
@Bean
public CronTriggerFactoryBean insideTrackTrigger() {
	CronTriggerFactoryBean cronTriggerFactoryBean = new CronTriggerFactoryBean();
	cronTriggerFactoryBean.setJobDetail(insideTrackJob().getObject());
	cronTriggerFactoryBean.setCronExpression("0 0 * * * ?"); // Every hour
	cronTriggerFactoryBean.setGroup("lemonaid-quartz");
	return cronTriggerFactoryBean;
}
 
开发者ID:sapmentors,项目名称:lemonaid,代码行数:9,代码来源:QuartzConfig.java


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