本文整理汇总了Java中org.quartz.SimpleTrigger.getRepeatInterval方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleTrigger.getRepeatInterval方法的具体用法?Java SimpleTrigger.getRepeatInterval怎么用?Java SimpleTrigger.getRepeatInterval使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.quartz.SimpleTrigger
的用法示例。
在下文中一共展示了SimpleTrigger.getRepeatInterval方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toCompositeData
import org.quartz.SimpleTrigger; //导入方法依赖的package包/类
public static CompositeData toCompositeData(SimpleTrigger trigger) {
try {
return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
new Object[] {
trigger.getRepeatCount(),
trigger.getRepeatInterval(),
trigger.getTimesTriggered(),
trigger.getKey().getName(),
trigger.getKey().getGroup(),
trigger.getJobKey().getName(),
trigger.getJobKey().getGroup(),
trigger.getDescription(),
JobDataMapSupport.toTabularData(trigger
.getJobDataMap()),
trigger.getCalendarName(),
((OperableTrigger)trigger).getFireInstanceId(),
trigger.getMisfireInstruction(),
trigger.getPriority(), trigger.getStartTime(),
trigger.getEndTime(), trigger.getNextFireTime(),
trigger.getPreviousFireTime(),
trigger.getFinalFireTime() });
} catch (OpenDataException e) {
throw new RuntimeException(e);
}
}
示例2: buildRepeatingSchedulableJob
import org.quartz.SimpleTrigger; //导入方法依赖的package包/类
private static SchedulableJob buildRepeatingSchedulableJob(Trigger trigger, JobDataMap dataMap) {
RepeatingSchedulableJob job = new RepeatingSchedulableJob();
long interval;
if (trigger instanceof CalendarIntervalTrigger) {
CalendarIntervalTrigger calendarTrigger = (CalendarIntervalTrigger) trigger;
interval = calendarTrigger.getRepeatInterval();
} else {
SimpleTrigger simpleTrigger = (SimpleTrigger) trigger;
job.setRepeatCount(simpleTrigger.getRepeatCount());
interval = simpleTrigger.getRepeatInterval() / SECOND;
}
job.setEndDate(getEndDate(trigger));
job.setRepeatIntervalInSeconds((int) interval);
job.setIgnorePastFiresAtStart(dataMap.getBoolean(IGNORE_PAST_FIRES_AT_START));
job.setUseOriginalFireTimeAfterMisfire(dataMap.getBoolean(USE_ORIGINAL_FIRE_TIME_AFTER_MISFIRE));
return job;
}
示例3: hasTriggerChanged
import org.quartz.SimpleTrigger; //导入方法依赖的package包/类
private boolean hasTriggerChanged(Trigger oldTrigger, Trigger newTrigger) {
if (newTrigger instanceof CronTrigger && oldTrigger instanceof CronTrigger) {
CronTrigger newCron = (CronTrigger) newTrigger;
CronTrigger oldCron = (CronTrigger) oldTrigger;
return !newCron.getCronExpression().equals(oldCron.getCronExpression());
} else if (newTrigger instanceof SimpleTrigger && oldTrigger instanceof SimpleTrigger) {
SimpleTrigger newSimple = (SimpleTrigger) newTrigger;
SimpleTrigger oldSimple = (SimpleTrigger) oldTrigger;
return newSimple.getRepeatInterval() != oldSimple.getRepeatInterval()
|| newSimple.getRepeatCount() != oldSimple.getRepeatCount();
} else {
return !newTrigger.getClass().equals(oldTrigger.getClass()) || !newTrigger.equals(oldTrigger);
}
}
示例4: testRestartAppChangeTriggerOptions
import org.quartz.SimpleTrigger; //导入方法依赖的package包/类
@Test
public void testRestartAppChangeTriggerOptions() throws Exception {
// Test creates application context twice with different simple trigger options in configuration xml.
// Both times it retrieves back the option, accessing it via trigger (so, using value stored in DB).
// After that it asserts that two options are not equal.
// load spring app
AbstractXmlApplicationContext app = new ClassPathXmlApplicationContext("org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppChangeOptionsTest1.xml");
app.start();
CamelContext camel = app.getBean("camelContext", CamelContext.class);
assertNotNull(camel);
SimpleTrigger trigger = (SimpleTrigger) getTrigger(camel, "quartzRoute");
long repeatInterval = trigger.getRepeatInterval();
app.stop();
log.info("Restarting ...");
log.info("Restarting ...");
log.info("Restarting ...");
// load spring app
AbstractXmlApplicationContext app2 = new ClassPathXmlApplicationContext("org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartAppChangeOptionsTest2.xml");
app2.start();
CamelContext camel2 = app2.getBean("camelContext", CamelContext.class);
assertNotNull(camel2);
SimpleTrigger trigger2 = (SimpleTrigger) getTrigger(camel2, "quartzRoute");
long repeatInterval2 = trigger2.getRepeatInterval();
app2.stop();
// we're done so let's properly close the application contexts, but close
// the second app before the first one so that the quartz scheduler running
// inside it can be properly shutdown
IOHelper.close(app2, app);
assertNotEquals(repeatInterval, repeatInterval2);
}
示例5: hasTriggerChanged
import org.quartz.SimpleTrigger; //导入方法依赖的package包/类
private static boolean hasTriggerChanged(Trigger oldTrigger, Trigger newTrigger) {
if (newTrigger instanceof CronTrigger && oldTrigger instanceof CronTrigger) {
CronTrigger newCron = (CronTrigger) newTrigger;
CronTrigger oldCron = (CronTrigger) oldTrigger;
return !newCron.getCronExpression().equals(oldCron.getCronExpression());
} else if (newTrigger instanceof SimpleTrigger && oldTrigger instanceof SimpleTrigger) {
SimpleTrigger newSimple = (SimpleTrigger) newTrigger;
SimpleTrigger oldSimple = (SimpleTrigger) oldTrigger;
return newSimple.getRepeatInterval() != oldSimple.getRepeatInterval()
|| newSimple.getRepeatCount() != oldSimple.getRepeatCount();
} else {
return !newTrigger.getClass().equals(oldTrigger.getClass()) || !newTrigger.equals(oldTrigger);
}
}
示例6: testRestartAppChangeTriggerOptions
import org.quartz.SimpleTrigger; //导入方法依赖的package包/类
@Test
public void testRestartAppChangeTriggerOptions() throws Exception {
// Test creates application context twice with different simple trigger options in configuration xml.
// Both times it retrieves back the option, accessing it via trigger (so, using value stored in DB).
// After that it asserts that two options are not equal.
// load spring app
AbstractXmlApplicationContext app = new ClassPathXmlApplicationContext("org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppChangeOptionsTest1.xml");
app.start();
CamelContext camel = app.getBean("camelContext", CamelContext.class);
assertNotNull(camel);
SimpleTrigger trigger = (SimpleTrigger) getTrigger(camel, "quartzRoute");
long repeatInterval = trigger.getRepeatInterval();
app.stop();
log.info("Restarting ...");
log.info("Restarting ...");
log.info("Restarting ...");
// load spring app
AbstractXmlApplicationContext app2 = new ClassPathXmlApplicationContext("org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppChangeOptionsTest2.xml");
app2.start();
CamelContext camel2 = app2.getBean("camelContext", CamelContext.class);
assertNotNull(camel2);
SimpleTrigger trigger2 = (SimpleTrigger) getTrigger(camel2, "quartzRoute");
long repeatInterval2 = trigger2.getRepeatInterval();
app2.stop();
// we're done so let's properly close the application contexts, but close
// the second app before the first one so that the quartz scheduler running
// inside it can be properly shutdown
IOHelper.close(app2, app);
assertNotEquals(repeatInterval, repeatInterval2);
}
示例7: getSimpleTriggerRepeatInterval
import org.quartz.SimpleTrigger; //导入方法依赖的package包/类
long getSimpleTriggerRepeatInterval(SimpleTrigger trigger) {
return trigger.getRepeatInterval();
}
示例8: getSimpleTriggerRepeatInterval
import org.quartz.SimpleTrigger; //导入方法依赖的package包/类
@Override
long getSimpleTriggerRepeatInterval(SimpleTrigger trigger) {
return trigger.getRepeatInterval(); // NOPMD
}