@Override public void timerExpired(Timer timer) { Date actualExecutionTime = new Date(); super.timerExpired(timer); Date completionTime = new Date(); this.triggerContext.update(this.scheduledExecutionTime, actualExecutionTime, completionTime); if (!this.cancelled) { schedule(); } }
public ScheduledFuture scheduleWithFixedDelay(Runnable task, long delay) { TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, true)); Timer timer = getTimerManager().schedule(futureTask, 0, delay); futureTask.setTimer(timer); return futureTask; }
public ScheduledFuture scheduleAtFixedRate(Runnable task, long period) { TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, true)); Timer timer = getTimerManager().scheduleAtFixedRate(futureTask, 0, period); futureTask.setTimer(timer); return futureTask; }
public ScheduledFuture schedule(Runnable task, Date startTime) { TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, false)); Timer timer = getTimerManager().schedule(futureTask, startTime); futureTask.setTimer(timer); return futureTask; }