當前位置: 首頁>>代碼示例>>Java>>正文


Java SimpleTrigger.getRepeatInterval方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:26,代碼來源:SimpleTriggerSupport.java

示例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;
}
 
開發者ID:motech,項目名稱:motech,代碼行數:21,代碼來源:SchedulableJobBuilder.java

示例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);
    }
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:15,代碼來源:QuartzEndpoint.java

示例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);
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:37,代碼來源:SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java

示例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);
    }
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:15,代碼來源:QuartzComponent.java

示例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);
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:37,代碼來源:SpringQuartzPersistentStoreRestartAppChangeOptionsTest.java

示例7: getSimpleTriggerRepeatInterval

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
long getSimpleTriggerRepeatInterval(SimpleTrigger trigger) {
	return trigger.getRepeatInterval();
}
 
開發者ID:javamelody,項目名稱:javamelody,代碼行數:4,代碼來源:QuartzAdapter.java

示例8: getSimpleTriggerRepeatInterval

import org.quartz.SimpleTrigger; //導入方法依賴的package包/類
@Override
long getSimpleTriggerRepeatInterval(SimpleTrigger trigger) {
	return trigger.getRepeatInterval(); // NOPMD
}
 
開發者ID:javamelody,項目名稱:javamelody,代碼行數:5,代碼來源:Quartz2Adapter.java


注:本文中的org.quartz.SimpleTrigger.getRepeatInterval方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。