From 4b55333b0e0d9aa2d15fdf5614b0718745299c07 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 12 Jun 2023 12:55:09 +0200 Subject: [PATCH] Document which @Scheduled attributes support SpEL expressions Closes gh-29290 (cherry picked from commit f8c8873c99e8064d9ba6b1c8d86217f019d46daa) --- .../scheduling/annotation/Scheduled.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java index f3aa81296a23..983d341e7823 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2023 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. @@ -117,9 +117,12 @@ * last invocation and the start of the next. *

The time unit is milliseconds by default but can be overridden via * {@link #timeUnit}. + *

This attribute variant supports Spring-style "${...}" placeholders + * as well as SpEL expressions. * @return the delay as a String value — for example, a placeholder * or a {@link java.time.Duration#parse java.time.Duration} compliant value * @since 3.2.2 + * @see #fixedDelay() */ String fixedDelayString() default ""; @@ -135,9 +138,12 @@ * Execute the annotated method with a fixed period between invocations. *

The time unit is milliseconds by default but can be overridden via * {@link #timeUnit}. + *

This attribute variant supports Spring-style "${...}" placeholders + * as well as SpEL expressions. * @return the period as a String value — for example, a placeholder * or a {@link java.time.Duration#parse java.time.Duration} compliant value * @since 3.2.2 + * @see #fixedRate() */ String fixedRateString() default ""; @@ -156,9 +162,12 @@ * {@link #fixedRate} or {@link #fixedDelay} task. *

The time unit is milliseconds by default but can be overridden via * {@link #timeUnit}. + *

This attribute variant supports Spring-style "${...}" placeholders + * as well as SpEL expressions. * @return the initial delay as a String value — for example, a placeholder * or a {@link java.time.Duration#parse java.time.Duration} compliant value * @since 3.2.2 + * @see #initialDelay() */ String initialDelayString() default "";