本文整理汇总了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());
}
示例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 ();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}