本文整理汇总了Java中org.quartz.Trigger.getTriggerBuilder方法的典型用法代码示例。如果您正苦于以下问题:Java Trigger.getTriggerBuilder方法的具体用法?Java Trigger.getTriggerBuilder怎么用?Java Trigger.getTriggerBuilder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.quartz.Trigger
的用法示例。
在下文中一共展示了Trigger.getTriggerBuilder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateExistingTrigger
import org.quartz.Trigger; //导入方法依赖的package包/类
private void updateExistingTrigger(Trigger quartzTrigger, Trigger existingQuartzTrigger) throws SchedulerException {
if (!quartzTrigger.getJobKey().equals(existingQuartzTrigger.getJobKey())) {
throw new SchedulingException(
String.format("the updated trigger's job has to be identical to that of the previous trigger. tried changing [%s] to [%s]",
existingQuartzTrigger.getJobKey().toString(), quartzTrigger.getJobKey().toString()));
}
TriggerBuilder triggerUpdater = existingQuartzTrigger.getTriggerBuilder();
Trigger updatedTrigger = triggerUpdater.forJob(quartzTrigger.getJobKey())
.withSchedule(quartzTrigger.getScheduleBuilder())
.build();
updatedTrigger.getJobDataMap().putAll(quartzTrigger.getJobDataMap());
scheduler.rescheduleJob(updatedTrigger.getKey(), updatedTrigger);
}