Annotation Interface Scheduled
@Documented
@Retention(RUNTIME)
@Target({METHOD,ANNOTATION_TYPE})
@Executable(processOnStartup=true)
@Repeatable(Schedules.class)
@Parallel
public @interface Scheduled
An annotation for scheduling a re-occurring task.
- Since:
- 1.0
- Author:
- graemerocher
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionA custom expression that can be used to indicate whether the job should run.A String representation of theDurationbetween the time of the last execution and the beginning of the next.A String representation of theDurationbetween executions.A String representation of theDurationbefore starting executions.A String representation of theZoneIdto base our cron expression on.
-
Element Details
-
cron
-
zoneId
String zoneIdA String representation of theZoneIdto base our cron expression on. Defaults toZoneId.systemDefault()- Returns:
- The ZoneId to base the cron expression on
- Default:
""
-
fixedDelay
-
initialDelay
-
fixedRate
-
scheduler
String scheduler- Returns:
- The name of a
Namedbean that is aScheduledExecutorServiceto use to schedule the task
- Default:
"scheduled"
-
condition
String conditionA custom expression that can be used to indicate whether the job should run. Will be evaluated each time the job is scheduled to run and if the condition evaluates to false the job will not run.- Returns:
- The condition
- Since:
- 4.0.0
- Default:
""
-