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
Modifier and TypeOptional ElementDescriptionA custom expression that can be used to indicate whether the job should run.A String representation of theDuration
between the time of the last execution and the beginning of the next.A String representation of theDuration
between executions.A String representation of theDuration
before starting executions.A String representation of theZoneId
to base our cron expression on.
-
Element Details
-
cron
String cron- Returns:
- The CRON expression
- Default:
- ""
-
zoneId
String zoneIdA String representation of theZoneId
to base our cron expression on. Defaults toZoneId.systemDefault()
- Returns:
- The ZoneId to base the cron expression on
- Default:
- ""
-
fixedDelay
String fixedDelayA String representation of theDuration
between the time of the last execution and the beginning of the next. For example 10m == 10 minutes- Returns:
- The fixed delay
- Default:
- ""
-
initialDelay
String initialDelayA String representation of theDuration
before starting executions. For example 10m == 10 minutes- Returns:
- The fixed delay
- Default:
- ""
-
fixedRate
String fixedRateA String representation of theDuration
between executions. For example 10m == 10 minutes- Returns:
- The fixed rate
- Default:
- ""
-
scheduler
String scheduler- Returns:
- The name of a
Named
bean that is aScheduledExecutorService
to 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:
- ""
-