Class CronTrigger
java.lang.Object
org.springframework.scheduling.support.CronTrigger
- All Implemented Interfaces:
- Trigger
Trigger implementation for cron expressions.
 Wraps a CronExpression.- Since:
- 3.0
- Author:
- Juergen Hoeller, Arjen Poutsma
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionCronTrigger(String expression) Build aCronTriggerfrom the pattern provided in the default time zone.CronTrigger(String expression, ZoneId zoneId) Build aCronTriggerfrom the pattern provided in the given time zone.CronTrigger(String expression, TimeZone timeZone) Build aCronTriggerfrom the pattern provided in the given time zone.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturn the cron pattern that this trigger has been built with.inthashCode()nextExecution(TriggerContext triggerContext) Determine the next execution time according to the given trigger context.toString()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.scheduling.TriggernextExecutionTime
- 
Constructor Details- 
CronTriggerBuild aCronTriggerfrom the pattern provided in the default time zone.- Parameters:
- expression- a space-separated list of time fields, following cron expression conventions
 
- 
CronTriggerBuild aCronTriggerfrom the pattern provided in the given time zone.- Parameters:
- expression- a space-separated list of time fields, following cron expression conventions
- timeZone- a time zone in which the trigger times will be generated
 
- 
CronTriggerBuild aCronTriggerfrom the pattern provided in the given time zone.- Parameters:
- expression- a space-separated list of time fields, following cron expression conventions
- zoneId- a time zone in which the trigger times will be generated
- Since:
- 5.3
- See Also:
 
 
- 
- 
Method Details- 
getExpressionReturn the cron pattern that this trigger has been built with.
- 
nextExecutionDetermine the next execution time according to the given trigger context.Next execution times are calculated based on the completion time of the previous execution; therefore, overlapping executions won't occur. - Specified by:
- nextExecutionin interface- Trigger
- Parameters:
- triggerContext- context object encapsulating last execution times and last completion time
- Returns:
- the next execution time as defined by the trigger,
 or nullif the trigger won't fire anymore
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-