本文整理了Java中org.quartz.Trigger.getFireTimeAfter()
方法的一些代码示例,展示了Trigger.getFireTimeAfter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Trigger.getFireTimeAfter()
方法的具体详情如下:
包路径:org.quartz.Trigger
类名称:Trigger
方法名:getFireTimeAfter
[英]Returns the next time at which the Trigger
will fire, after the given time. If the trigger will not fire after the given time, null
will be returned.
[中]返回给定时间后Trigger
将触发的下一次时间。如果触发器在给定时间后不触发,将返回null
。
代码示例来源:origin: apache/incubator-gobblin
/** {@inheritDoc} */
@Override protected JobSpecSchedule doScheduleJob(JobSpec jobSpec, Runnable jobRunnable) {
// Build a data map that gets passed to the job
JobDataMap jobDataMap = new JobDataMap();
jobDataMap.put(JOB_SPEC_KEY, jobSpec);
jobDataMap.put(JOB_RUNNABLE_KEY, jobRunnable);
// Build a Quartz job
JobDetail job = JobBuilder.newJob(QuartzJob.class)
.withIdentity(jobSpec.getUri().toString())
.withDescription(Strings.nullToEmpty(jobSpec.getDescription()))
.usingJobData(jobDataMap)
.build();
Trigger jobTrigger = createTrigger(job.getKey(), jobSpec);
QuartzJobSchedule jobSchedule = new QuartzJobSchedule(jobSpec, jobRunnable, jobTrigger);
try {
_scheduler.getScheduler().scheduleJob(job, jobTrigger);
getLog().info(String.format("Scheduled job %s next two fire times: %s , %s.", jobSpec, jobTrigger.getNextFireTime(),
jobTrigger.getFireTimeAfter(jobTrigger.getNextFireTime())));
} catch (SchedulerException e) {
throw new RuntimeException("Scheduling failed for " + jobSpec + ":" + e, e);
}
return jobSchedule;
}
代码示例来源:origin: org.opencms/opencms-core
/**
* Returns the next time at which this job will be executed, after the given time.<p>
*
* If this job will not be executed after the given time, <code>null</code> will be returned..<p>
*
* @param date the after which the next execution time should be calculated
* @return the next time at which this job will be executed, after the given time
*/
public Date getExecutionTimeAfter(Date date) {
if (!m_active || (m_trigger == null)) {
// if the job is not active, no time can be calculated
return null;
}
return m_trigger.getFireTimeAfter(date);
}
代码示例来源:origin: org.opencms/opencms-solr
/**
* Returns the next time at which this job will be executed, after the given time.<p>
*
* If this job will not be executed after the given time, <code>null</code> will be returned..<p>
*
* @param date the after which the next execution time should be calculated
* @return the next time at which this job will be executed, after the given time
*/
public Date getExecutionTimeAfter(Date date) {
if (!m_active || (m_trigger == null)) {
// if the job is not active, no time can be calculated
return null;
}
return m_trigger.getFireTimeAfter(date);
}
代码示例来源:origin: org.motechproject/motech-scheduler
private Date getFirstTriggerInFuture(Trigger trigger, DateTime now) { // extracted away because of checkstyle :(
Date newStartTime = trigger.getFireTimeAfter(now.toDate());
if (newStartTime == null) {
newStartTime = now.toDate();
}
return newStartTime;
}
代码示例来源:origin: com.atlassian.scheduler/atlassian-scheduler-quartz1
@Nullable
@Override
public Date calculateNextRunTime(Schedule schedule) throws SchedulerServiceException {
final Trigger trigger = triggerFactory.buildTrigger(schedule);
return trigger.getFireTimeAfter(new Date());
}
代码示例来源:origin: pl.touk.hades/hades-quartz
private Date computeNextFireTimeAvoidingMisfires(Date fireTime, Trigger quartzTrigger) {
return quartzTrigger.getFireTimeAfter(getDateOneSecondAgoButAfter(fireTime));
}
代码示例来源:origin: org.commonjava.aprox/aprox-core
final Date nextFire = trigger.getFireTimeAfter( new Date() );
if ( nextFire == null || !nextFire.after( to ) )
代码示例来源:origin: pentaho/pentaho-platform
Date nextFireTime = trigger.getFireTimeAfter( startDate );
代码示例来源:origin: com.linkedin.gobblin/gobblin-runtime
/** {@inheritDoc} */
@Override protected JobSpecSchedule doScheduleJob(JobSpec jobSpec, Runnable jobRunnable) {
// Build a data map that gets passed to the job
JobDataMap jobDataMap = new JobDataMap();
jobDataMap.put(JOB_SPEC_KEY, jobSpec);
jobDataMap.put(JOB_RUNNABLE_KEY, jobRunnable);
// Build a Quartz job
JobDetail job = JobBuilder.newJob(QuartzJob.class)
.withIdentity(jobSpec.getUri().toString())
.withDescription(Strings.nullToEmpty(jobSpec.getDescription()))
.usingJobData(jobDataMap)
.build();
Trigger jobTrigger = createTrigger(job.getKey(), jobSpec);
QuartzJobSchedule jobSchedule = new QuartzJobSchedule(jobSpec, jobRunnable, jobTrigger);
try {
_scheduler.getScheduler().scheduleJob(job, jobTrigger);
getLog().info(String.format("Scheduled job %s next two fire times: %s , %s.", jobSpec, jobTrigger.getNextFireTime(),
jobTrigger.getFireTimeAfter(jobTrigger.getNextFireTime())));
} catch (SchedulerException e) {
throw new RuntimeException("Scheduling failed for " + jobSpec + ":" + e, e);
}
return jobSchedule;
}
代码示例来源:origin: org.apache.gobblin/gobblin-runtime
/** {@inheritDoc} */
@Override protected JobSpecSchedule doScheduleJob(JobSpec jobSpec, Runnable jobRunnable) {
// Build a data map that gets passed to the job
JobDataMap jobDataMap = new JobDataMap();
jobDataMap.put(JOB_SPEC_KEY, jobSpec);
jobDataMap.put(JOB_RUNNABLE_KEY, jobRunnable);
// Build a Quartz job
JobDetail job = JobBuilder.newJob(QuartzJob.class)
.withIdentity(jobSpec.getUri().toString())
.withDescription(Strings.nullToEmpty(jobSpec.getDescription()))
.usingJobData(jobDataMap)
.build();
Trigger jobTrigger = createTrigger(job.getKey(), jobSpec);
QuartzJobSchedule jobSchedule = new QuartzJobSchedule(jobSpec, jobRunnable, jobTrigger);
try {
_scheduler.getScheduler().scheduleJob(job, jobTrigger);
getLog().info(String.format("Scheduled job %s next two fire times: %s , %s.", jobSpec, jobTrigger.getNextFireTime(),
jobTrigger.getFireTimeAfter(jobTrigger.getNextFireTime())));
} catch (SchedulerException e) {
throw new RuntimeException("Scheduling failed for " + jobSpec + ":" + e, e);
}
return jobSchedule;
}
代码示例来源:origin: cdapio/cdap
continue;
Date nextFireTime = trigger.getFireTimeAfter(startTime);
String triggerKeyString = trigger.getKey().toString();
while (nextFireTime != null && nextFireTime.getTime() < endTimeMillis) {
ScheduledRuntime runtime = new ScheduledRuntime(triggerKeyString, nextFireTime.getTime());
scheduledRuntimes.add(runtime);
nextFireTime = trigger.getFireTimeAfter(nextFireTime);
代码示例来源:origin: co.cask.cdap/cdap-app-fabric
continue;
Date nextFireTime = trigger.getFireTimeAfter(startTime);
String triggerKeyString = trigger.getKey().toString();
while (nextFireTime != null && nextFireTime.getTime() < endTimeMillis) {
ScheduledRuntime runtime = new ScheduledRuntime(triggerKeyString, nextFireTime.getTime());
scheduledRuntimes.add(runtime);
nextFireTime = trigger.getFireTimeAfter(nextFireTime);
代码示例来源:origin: Alfresco/alfresco-repository
.startAt(scheduleStart)
.build();
Date nextFireFromNow = testT.getFireTimeAfter(new Date());
Date nextFireFromLast = testT.getFireTimeAfter(lastExecutedAt);
代码示例来源:origin: org.alfresco/alfresco-repository
.startAt(scheduleStart)
.build();
Date nextFireFromNow = testT.getFireTimeAfter(new Date());
Date nextFireFromLast = testT.getFireTimeAfter(lastExecutedAt);
代码示例来源:origin: pentaho/pentaho-platform
setJobTrigger( scheduler, job, trigger );
job.setJobName( QuartzJobKey.parse( jobId ).getJobName() );
job.setNextRun( trigger.getFireTimeAfter( new Date() ) );
job.setLastRun( trigger.getPreviousFireTime() );
if ( ( filter == null ) || filter.accept( job ) ) {
代码示例来源:origin: Alfresco/alfresco-repository
assertEquals(future90mins, t.getFireTimeAfter(new Date()).getTime()); // After this, fire 4 hours from start
assertEquals(null, t.getEndTime());
内容来源于网络,如有侵权,请联系作者删除!