diff --git a/spring-context/src/main/java/org/springframework/scheduling/support/CronTrigger.java b/spring-context/src/main/java/org/springframework/scheduling/support/CronTrigger.java index 6f9bde66827385e913952a8a683f2d494c67d5b3..a32891a7d1ef55ea685b78712ca828ed972dc7f9 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/support/CronTrigger.java +++ b/spring-context/src/main/java/org/springframework/scheduling/support/CronTrigger.java @@ -16,12 +16,12 @@ package org.springframework.scheduling.support; -import org.springframework.scheduling.Trigger; -import org.springframework.scheduling.TriggerContext; - import java.util.Date; import java.util.TimeZone; +import org.springframework.scheduling.Trigger; +import org.springframework.scheduling.TriggerContext; + /** * {@link Trigger} implementation for cron expressions. * Wraps a {@link CronSequenceGenerator}. @@ -55,6 +55,12 @@ public class CronTrigger implements Trigger { } + /** + * Determine the next execution time according to the given trigger context. + *
Next execution times are calculated based on the + * {@linkplain TriggerContext#lastCompletionTime completion time} of the + * previous execution; therefore, overlapping executions won't occur. + */ @Override public Date nextExecutionTime(TriggerContext triggerContext) { Date date = triggerContext.lastCompletionTime();