From 2c32601553260aa1a11104aef0020f4d4732e308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Thu, 12 Dec 2024 17:32:18 +0100 Subject: [PATCH] Add note about using @EventListener on lazy beans Closes gh-34057 --- .../modules/ROOT/pages/core/beans/context-introduction.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc b/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc index 952f7ae0f6..612185813e 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc @@ -578,6 +578,8 @@ Kotlin:: ---- ====== +NOTE: Do not define such beans to be lazy as the `ApplicationContext` will honour that and will not register the method to listen to events. + The method signature once again declares the event type to which it listens, but, this time, with a flexible name and without implementing a specific listener interface. The event type can also be narrowed through generics as long as the actual event type