From b39ce80c879101ab132dcc794cee5e12abb5a668 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 29 May 2018 21:52:51 +0200 Subject: [PATCH] Doc: @EnableScheduling needs to be declared per application context Issue: SPR-16852 --- .../scheduling/annotation/EnableScheduling.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableScheduling.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableScheduling.java index 9b5b8059946..546a62135a3 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableScheduling.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableScheduling.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -187,6 +187,12 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar; * but one demonstration how the code-based approach allows for maximum configurability * through direct access to actual componentry.

* + * Note: {@code @EnableScheduling} applies to its local application context only, + * allowing for selective scheduling of beans at different levels. Please redeclare + * {@code @EnableScheduling} in each individual context, e.g. the common root web + * application context and any separate {@code DispatcherServlet} application contexts, + * if you need to apply its behavior at multiple levels. + * * @author Chris Beams * @author Juergen Hoeller * @since 3.1