@groovy.transform.CompileStatic class ScheduledJobRunner extends java.lang.Object implements java.lang.Runnable
Runs scheduled jobs as defined in ServiceJob records with a cronExpression. Cron expression uses Quartz flavored syntax. Uses cron-utils for cron processing, see: https://github.com/jmrozanec/cron-utils For a Quartz cron reference see: http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html https://www.quartz-scheduler.org/api/2.2.1/org/quartz/CronExpression.html Handy cron strings: [0 0 2 * * ?] every night at 2:00 am, [0 0/15 * * * ?] every 15 minutes, [0 0/2 * * * ?] every 2 minutes
Constructor and description |
---|
ScheduledJobRunner
(ExecutionContextFactoryImpl ecfi) |
Type Params | Return Type | Name and description |
---|---|---|
|
static com.cronutils.model.Cron |
getCron(java.lang.String cronExpression) |
|
static java.lang.String |
getCronDescription(java.lang.String cronExpression, java.util.Locale locale, boolean handleInvalid) |
|
int |
getExecuteCount() |
|
static com.cronutils.model.time.ExecutionTime |
getExecutionTime(java.lang.String cronExpression) |
|
long |
getLastExecuteTime() |
|
int |
getLastJobsActive() |
|
int |
getLastJobsPaused() |
|
int |
getTotalJobsRun() |
|
static boolean |
isLastRunBeforeLastSchedule(java.lang.String cronExpression, java.sql.Timestamp lastRun, java.lang.String description, java.sql.Timestamp nowTimestamp) Use to determine if it is time to run again, if returns true then run and if false don't run. |
|
void |
run() |
|
void |
runInternal() |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Use to determine if it is time to run again, if returns true then run and if false don't run. See if lastRun is before last scheduled run time based on cronExpression and nowTimestamp (defaults to current date/time)