Commit f52cdf10 authored by Andy Wilkinson's avatar Andy Wilkinson

Update WebServerInitEvent docs to reflect ordering w.r.t. refresh

Closes gh-22277
parent f18b657f
...@@ -319,9 +319,9 @@ Application events are sent in the following order, as your application runs: ...@@ -319,9 +319,9 @@ Application events are sent in the following order, as your application runs:
The above list only includes ``SpringApplicationEvent``s that are tied to a `SpringApplication`. The above list only includes ``SpringApplicationEvent``s that are tied to a `SpringApplication`.
In addition to these, the following events are also published after `ApplicationPreparedEvent` and before `ApplicationStartedEvent`: In addition to these, the following events are also published after `ApplicationPreparedEvent` and before `ApplicationStartedEvent`:
. A `ContextRefreshedEvent` is sent when an `ApplicationContext` is refreshed. - A `WebServerInitializedEvent` is sent after the `WebServer` is ready.
. A `WebServerInitializedEvent` is sent after the `WebServer` is ready.
`ServletWebServerInitializedEvent` and `ReactiveWebServerInitializedEvent` are the servlet and reactive variants respectively. `ServletWebServerInitializedEvent` and `ReactiveWebServerInitializedEvent` are the servlet and reactive variants respectively.
- A `ContextRefreshedEvent` is sent when an `ApplicationContext` is refreshed.
TIP: You often need not use application events, but it can be handy to know that they exist. TIP: You often need not use application events, but it can be handy to know that they exist.
Internally, Spring Boot uses events to handle a variety of tasks. Internally, Spring Boot uses events to handle a variety of tasks.
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -20,8 +20,8 @@ import org.springframework.boot.web.server.WebServer; ...@@ -20,8 +20,8 @@ import org.springframework.boot.web.server.WebServer;
import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationEvent;
/** /**
* Event to be published after the application context is refreshed and the * Event to be published when the {@link WebServer} is ready. Useful for obtaining the
* {@link WebServer} is ready. Useful for obtaining the local port of a running server. * local port of a running server.
* *
* @author Brian Clozel * @author Brian Clozel
* @author Stephane Nicoll * @author Stephane Nicoll
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -20,9 +20,8 @@ import org.springframework.boot.web.context.WebServerInitializedEvent; ...@@ -20,9 +20,8 @@ import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServer;
/** /**
* Event to be published after the {@link ReactiveWebServerApplicationContext} is * Event to be published after the {@link WebServer} is ready. Useful for obtaining the
* refreshed and the {@link WebServer} is ready. Useful for obtaining the local port of a * local port of a running server.
* running server.
* *
* @author Brian Clozel * @author Brian Clozel
* @author Stephane Nicoll * @author Stephane Nicoll
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -20,9 +20,8 @@ import org.springframework.boot.web.context.WebServerInitializedEvent; ...@@ -20,9 +20,8 @@ import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServer;
/** /**
* Event to be published after the {@link ServletWebServerApplicationContext} is refreshed * Event to be published after the {@link WebServer} is ready. Useful for obtaining the
* and the {@link WebServer} is ready. Useful for obtaining the local port of a running * local port of a running server.
* server.
* *
* <p> * <p>
* Normally it will have been started, but listeners are free to inspect the server and * Normally it will have been started, but listeners are free to inspect the server and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment