当前位置: 首页>>代码示例>>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;未经允许,请勿转载。