public class CronExpressionSchedule extends Object implements Schedule
Schedule based on a
Cron expression.CronExpressionSchedule.
Since the Cron library is marked as optional in Wisp, it has to be
explicitly referenced in the project dependency configuration
(pom.xml, build.gradle, build.sbt etc.).CronExpression for format details and implementation.WILL_NOT_BE_EXECUTED_AGAIN, willNeverBeExecuted| Constructor and Description |
|---|
CronExpressionSchedule(fc.cron.CronExpression cronExpression) |
CronExpressionSchedule(fc.cron.CronExpression cronExpression,
ZoneId zoneId) |
| Modifier and Type | Method and Description |
|---|---|
long |
nextExecutionInMillis(long currentTimeInMillis,
int executionsCount,
Long lastExecutionTimeInMillis)
Compute the next execution time for a job.
|
static CronExpressionSchedule |
parse(String cronExpression)
Create a
Schedule from a cron expression based on the Unix format,
e.g. 1 * * * * for each minute. |
static CronExpressionSchedule |
parseWithSeconds(String cronExpression)
Create a
Schedule from a cron expression based on the Unix format, but accepting a second field as the first one,
e.g. 29 * * * * * for each minute at the second 29, for instance 12:05:29. |
String |
toString() |
public CronExpressionSchedule(fc.cron.CronExpression cronExpression,
ZoneId zoneId)
public CronExpressionSchedule(fc.cron.CronExpression cronExpression)
public long nextExecutionInMillis(long currentTimeInMillis,
int executionsCount,
Long lastExecutionTimeInMillis)
SchedulenextExecutionInMillis in interface SchedulecurrentTimeInMillis - The current time in milliseconds. This time must be used if
a next execution is planned for the jobexecutionsCount - The number of times a job has already been executedlastExecutionTimeInMillis - The time at which the job has last been executed; will be null
if the job has never been executedcurrentTimeInMillis.
If the returned value is negative, the job will not be executed again.public static CronExpressionSchedule parse(String cronExpression)
Schedule from a cron expression based on the Unix format,
e.g. 1 * * * * for each minute.public static CronExpressionSchedule parseWithSeconds(String cronExpression)
Schedule from a cron expression based on the Unix format, but accepting a second field as the first one,
e.g. 29 * * * * * for each minute at the second 29, for instance 12:05:29.Copyright © 2023 Coreoz. All rights reserved.