@@ -268,6 +268,8 @@ Application events are sent in the following order, as your application runs:
268
268
except for the registration of listeners and initializers.
269
269
. An `ApplicationEnvironmentPreparedEvent` is sent when the `Environment` to be used in
270
270
the context is known but before the context is created.
271
+ . An `ApplicationContextInitializedEvent` is sent when the `ApplicationContext` is prepared
272
+ and ApplicationContextInitializers have been called but before any bean definitions are loaded.
271
273
. An `ApplicationPreparedEvent` is sent just before the refresh is started but after bean
272
274
definitions have been loaded.
273
275
. An `ApplicationStartedEvent` is sent after the context has been refreshed but before any
@@ -276,6 +278,14 @@ application and command-line runners have been called.
276
278
been called. It indicates that the application is ready to service requests.
277
279
. An `ApplicationFailedEvent` is sent if there is an exception on startup.
278
280
281
+ The above list only includes `SpringApplicationEvent`s that are tied to a `SpringApplication`.
282
+ In addition to these, the following events are also published after `ApplicationPreparedEvent`
283
+ and before `ApplicationStartedEvent`:
284
+
285
+ . A `ContextRefreshedEvent` is sent when an `ApplicationContext` is refreshed.
286
+ . A `WebServerInitializedEvent` is sent after the `WebServer` is ready. `ServletWebServerInitializedEvent`
287
+ and `ReactiveWebServerInitializedEvent` are the servlet and reactive variants respectively.
288
+
279
289
TIP: You often need not use application events, but it can be handy to know that they
280
290
exist. Internally, Spring Boot uses events to handle a variety of tasks.
281
291
0 commit comments