File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
framework-docs/modules/ROOT/pages/integration
spring-context/src/main/java/org/springframework/scheduling/annotation Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,12 @@ Notice that the methods to be scheduled must have void returns and must not acce
380
380
arguments. If the method needs to interact with other objects from the application
381
381
context, those would typically have been provided through dependency injection.
382
382
383
+ `@Scheduled` can be used as a repeatable annotation. If several scheduled declarations
384
+ are found on the same method, each of them will be processed independently, with a
385
+ separate trigger firing for each of them. As a consequence, such co-located schedules
386
+ may overlap and execute multiple times in parallel or in immediate succession.
387
+ Please make sure that your specified cron expressions etc do not accidentally overlap.
388
+
383
389
[NOTE]
384
390
====
385
391
As of Spring Framework 4.3, `@Scheduled` methods are supported on beans of any scope.
Original file line number Diff line number Diff line change 29
29
30
30
/**
31
31
* Annotation that marks a method to be scheduled. Exactly one of the
32
- * {@link #cron}, {@link #fixedDelay}, or {@link #fixedRate} attributes must be
33
- * specified.
32
+ * {@link #cron}, {@link #fixedDelay}, or {@link #fixedRate} attributes
33
+ * must be specified.
34
34
*
35
35
* <p>The annotated method must expect no arguments. It will typically have
36
36
* a {@code void} return type; if not, the returned value will be ignored
42
42
* XML element or {@link EnableScheduling @EnableScheduling} annotation.
43
43
*
44
44
* <p>This annotation can be used as a <em>{@linkplain Repeatable repeatable}</em>
45
- * annotation.
45
+ * annotation. If several scheduled declarations are found on the same method,
46
+ * each of them will be processed independently, with a separate trigger firing
47
+ * for each of them. As a consequence, such co-located schedules may overlap
48
+ * and execute multiple times in parallel or in immediate succession.
46
49
*
47
50
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
48
51
* <em>composed annotations</em> with attribute overrides.
You can’t perform that action at this time.
0 commit comments