Search in sources :

Example 6 with OperableTrigger

use of org.quartz.spi.OperableTrigger in project scout.rt by eclipse.

the class JobFutureTask method createQuartzTrigger.

/**
 * Creates the Quartz Trigger to fire execution.
 */
protected OperableTrigger createQuartzTrigger(final JobInput input) {
    final TriggerBuilder<Trigger> builder = TriggerBuilder.newTrigger().forJob(JobFutureTask.class.getSimpleName());
    final ExecutionTrigger executionTrigger = input.getExecutionTrigger();
    if (executionTrigger != null) {
        builder.startAt(executionTrigger.getStartTime()).endAt(executionTrigger.getEndTime()).withSchedule(executionTrigger.getSchedule());
    }
    return (OperableTrigger) builder.build();
}
Also used : ExecutionTrigger(org.eclipse.scout.rt.platform.job.ExecutionTrigger) OperableTrigger(org.quartz.spi.OperableTrigger) Trigger(org.quartz.Trigger) OperableTrigger(org.quartz.spi.OperableTrigger) ExecutionTrigger(org.eclipse.scout.rt.platform.job.ExecutionTrigger)

Aggregations

Trigger (org.quartz.Trigger)6 OperableTrigger (org.quartz.spi.OperableTrigger)6 TriggerBuilder.newTrigger (org.quartz.TriggerBuilder.newTrigger)4 Date (java.util.Date)3 CronTrigger (org.quartz.CronTrigger)3 SimpleTrigger (org.quartz.SimpleTrigger)3 CronJobId (org.motechproject.scheduler.contract.CronJobId)2 JobId (org.motechproject.scheduler.contract.JobId)2 RepeatingJobId (org.motechproject.scheduler.contract.RepeatingJobId)2 RepeatingPeriodJobId (org.motechproject.scheduler.contract.RepeatingPeriodJobId)2 RunOnceJobId (org.motechproject.scheduler.contract.RunOnceJobId)2 MotechSchedulerException (org.motechproject.scheduler.exception.MotechSchedulerException)2 SchedulerException (org.quartz.SchedulerException)2 BaseCalendar (org.quartz.impl.calendar.BaseCalendar)2 SaturnScheduler (com.vip.saturn.job.trigger.SaturnScheduler)1 ArrayList (java.util.ArrayList)1 ExecutionTrigger (org.eclipse.scout.rt.platform.job.ExecutionTrigger)1 DateTime (org.joda.time.DateTime)1 Test (org.junit.Test)1 DateUtil.newDateTime (org.motechproject.commons.date.util.DateUtil.newDateTime)1