|
|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2002-2018 the original author or authors. |
|
|
|
|
* Copyright 2002-2019 the original author or authors. |
|
|
|
|
* |
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
|
@ -24,9 +24,9 @@ import java.lang.annotation.RetentionPolicy;
@@ -24,9 +24,9 @@ import java.lang.annotation.RetentionPolicy;
|
|
|
|
|
import java.lang.annotation.Target; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* An annotation that marks a method to be scheduled. Exactly one of |
|
|
|
|
* the {@link #cron()}, {@link #fixedDelay()}, or {@link #fixedRate()} |
|
|
|
|
* attributes must be specified. |
|
|
|
|
* Annotation that marks a method to be scheduled. Exactly one of the |
|
|
|
|
* {@link #cron}, {@link #fixedDelay}, or {@link #fixedRate} attributes must be |
|
|
|
|
* specified. |
|
|
|
|
* |
|
|
|
|
* <p>The annotated method must expect no arguments. It will typically have |
|
|
|
|
* a {@code void} return type; if not, the returned value will be ignored |
|
|
|
|
@ -57,8 +57,8 @@ public @interface Scheduled {
@@ -57,8 +57,8 @@ public @interface Scheduled {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* A special cron expression value that indicates a disabled trigger: {@value}. |
|
|
|
|
* <p>This is primarily meant for use with ${...} placeholders, allowing for |
|
|
|
|
* external disabling of corresponding scheduled methods. |
|
|
|
|
* <p>This is primarily meant for use with <code>${...}</code> placeholders, |
|
|
|
|
* allowing for external disabling of corresponding scheduled methods. |
|
|
|
|
* @since 5.1 |
|
|
|
|
*/ |
|
|
|
|
String CRON_DISABLED = "-"; |
|
|
|
|
@ -66,9 +66,10 @@ public @interface Scheduled {
@@ -66,9 +66,10 @@ public @interface Scheduled {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* A cron-like expression, extending the usual UN*X definition to include triggers |
|
|
|
|
* on the second, minute, hour, day of month, month and day of week. |
|
|
|
|
* <p>E.g. {@code "0 * * * * MON-FRI"} means once per minute on weekdays |
|
|
|
|
* (at the top of the minute - the 0th second). The order read from left to right is: |
|
|
|
|
* on the second, minute, hour, day of month, month, and day of week. |
|
|
|
|
* <p>For example, {@code "0 * * * * MON-FRI"} means once per minute on weekdays |
|
|
|
|
* (at the top of the minute - the 0th second). |
|
|
|
|
* <p>The fields read from left to right are interpreted as follows. |
|
|
|
|
* <ul> |
|
|
|
|
* <li>second</li> |
|
|
|
|
* <li>minute</li> |
|
|
|
|
@ -77,8 +78,9 @@ public @interface Scheduled {
@@ -77,8 +78,9 @@ public @interface Scheduled {
|
|
|
|
|
* <li>month</li> |
|
|
|
|
* <li>day of week</li> |
|
|
|
|
* </ul> |
|
|
|
|
* <p>The special value {@link #CRON_DISABLED "-"} indicates a disabled cron trigger, |
|
|
|
|
* primarily meant for externally specified values resolved by a ${...} placeholder. |
|
|
|
|
* <p>The special value {@link #CRON_DISABLED "-"} indicates a disabled cron |
|
|
|
|
* trigger, primarily meant for externally specified values resolved by a |
|
|
|
|
* <code>${...}</code> placeholder. |
|
|
|
|
* @return an expression that can be parsed to a cron schedule |
|
|
|
|
* @see org.springframework.scheduling.support.CronSequenceGenerator |
|
|
|
|
*/ |
|
|
|
|
@ -129,7 +131,7 @@ public @interface Scheduled {
@@ -129,7 +131,7 @@ public @interface Scheduled {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Number of milliseconds to delay before the first execution of a |
|
|
|
|
* {@link #fixedRate()} or {@link #fixedDelay()} task. |
|
|
|
|
* {@link #fixedRate} or {@link #fixedDelay} task. |
|
|
|
|
* @return the initial delay in milliseconds |
|
|
|
|
* @since 3.2 |
|
|
|
|
*/ |
|
|
|
|
@ -137,7 +139,7 @@ public @interface Scheduled {
@@ -137,7 +139,7 @@ public @interface Scheduled {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Number of milliseconds to delay before the first execution of a |
|
|
|
|
* {@link #fixedRate()} or {@link #fixedDelay()} task. |
|
|
|
|
* {@link #fixedRate} or {@link #fixedDelay} task. |
|
|
|
|
* @return the initial delay in milliseconds as a String value, e.g. a placeholder |
|
|
|
|
* or a {@link java.time.Duration#parse java.time.Duration} compliant value |
|
|
|
|
* @since 3.2.2 |
|
|
|
|
|