public int getRepeat() { return this.jobLocation.getRepeat(); }
long calculateNextExecutionTime(final JobLocation job, long currentTime, int repeat) throws MessageFormatException { long result = currentTime; String cron = job.getCronEntry(); if (cron != null && cron.length() > 0) { result = CronParser.getNextScheduledTime(cron, result); } else if (job.getRepeat() != 0) { result += job.getPeriod(); } return result; }
if (executionTime <= currentTime) { for (final JobLocation job : list) { int repeat = job.getRepeat(); nextExecutionTime = calculateNextExecutionTime(job, currentTime, repeat); long waitTime = nextExecutionTime - currentTime; schedule(jobId, payload, "", job.getDelay(), job.getPeriod(), job.getRepeat()); waitTime = job.getDelay() != 0 ? job.getDelay() : job.getPeriod(); this.scheduleTime.setWaitTime(waitTime);