Add explicit note on redeclaring in each application context

Closes gh-34843
This commit is contained in:
Juergen Hoeller
2025-04-30 17:55:18 +02:00
parent 03620fc530
commit 9c183f9e77

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2025 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.
@@ -146,6 +146,12 @@ import org.springframework.core.Ordered;
* compile-time weaving or load-time weaving applying the aspect to the affected classes.
* There is no proxy involved in such a scenario; local calls will be intercepted as well.
*
* <p><b>Note: {@code @EnableAsync} applies to its local application context only,
* allowing for selective activation at different levels.</b> Please redeclare
* {@code @EnableAsync} in each individual context, for example, 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
* @author Stephane Nicoll