本文整理匯總了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
}