与 7. initialDelay 意思相同,只是使⽤字符串的形式。唯⼀不同的是⽀持占位符。
That's all ! Thanks for reading.
附:
截⾄spring-context-4.3.14.RELEASE的源码
/**
* An 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
* when called through the scheduler.
*
* <p>Processing of {@code @Scheduled} annotations is performed by
* registering a {@link ScheduledAnnotationBeanPostProcessor}. This can be
* done manually or, more conveniently, through the {@code <task:annotation-driven/>}
* element or @{@link EnableScheduling} annotation.
*
* <p>This annotation may be ud as a <em>meta-annotation</em> to create custom
* <em>compod annotations</em> with attribute overrides.
*
* @author Mark Fisher
中国风水大师
* @author Dave Syer小孩零食
* @author Chris Beams
* @since 3.0
* @e EnableScheduling
* @e ScheduledAnnotationBeanPostProcessor
* @e Schedules
*/
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented南瓜禁忌
@Repeatable(Schedules.class)
public @interface Scheduled {
/**
* A cron-like expression, extending the usual UN*X definition to include
* triggers on the cond as well as minute, hour, day of month, month
* and day of week. e.g. {@code "0 * * * * MON-FRI"} means once per minute on
* weekdays (at the top of the minute - the 0th cond).
黑洞英语* @return an expression that can be pard to a cron schedule
* @e org.springframework.scheduling.support.CronSequenceGenerator水疗按摩
*/
String cron() default "";
/**
* A time zone for which the cron expression will be resolved. By default, this我的一家作文
* attribute is the empty String (i.e. the rver's local time zone will be ud).
* @return a zone id accepted by {@link java.util.TimeZone#getTimeZone(String)},茼蒿拼音
招商加盟广告宣传* or an empty String to indicate the rver's default time zone
* @since 4.0
* @e org.springframework.scheduling.support.CronTrigger#CronTrigger(String, java.util.TimeZone) * @e java.util.TimeZone
*/
String zone() default "";
/**
* Execute the annotated method with a fixed period in milliconds between the
* end of the last invocation and the start of the next.
* @return the delay in milliconds
*/
long fixedDelay() default -1;
/**
* Execute the annotated method with a fixed period in milliconds between the