Skip to content

Commit

Permalink
Update WebServerInitEvent docs to reflect ordering w.r.t. refresh
Browse files Browse the repository at this point in the history
Closes gh-22277
  • Loading branch information
wilkinsona committed Jul 13, 2020
1 parent f18b657 commit f52cdf1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Expand Up @@ -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`.
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.
- 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.
Internally, Spring Boot uses events to handle a variety of tasks.
Expand Down
@@ -1,5 +1,5 @@
/*
* 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");
* you may not use this file except in compliance with the License.
Expand All @@ -20,8 +20,8 @@
import org.springframework.context.ApplicationEvent;

/**
* Event to be published after the application context is refreshed and the
* {@link WebServer} is ready. Useful for obtaining the local port of a running server.
* Event to be published when the {@link WebServer} is ready. Useful for obtaining the
* local port of a running server.
*
* @author Brian Clozel
* @author Stephane Nicoll
Expand Down
@@ -1,5 +1,5 @@
/*
* 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");
* you may not use this file except in compliance with the License.
Expand All @@ -20,9 +20,8 @@
import org.springframework.boot.web.server.WebServer;

/**
* Event to be published after the {@link ReactiveWebServerApplicationContext} is
* refreshed and the {@link WebServer} is ready. Useful for obtaining the local port of a
* running server.
* Event to be published after the {@link WebServer} is ready. Useful for obtaining the
* local port of a running server.
*
* @author Brian Clozel
* @author Stephane Nicoll
Expand Down
@@ -1,5 +1,5 @@
/*
* 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");
* you may not use this file except in compliance with the License.
Expand All @@ -20,9 +20,8 @@
import org.springframework.boot.web.server.WebServer;

/**
* Event to be published after the {@link ServletWebServerApplicationContext} is refreshed
* and the {@link WebServer} is ready. Useful for obtaining the local port of a running
* server.
* Event to be published after the {@link WebServer} is ready. Useful for obtaining the
* local port of a running server.
*
* <p>
* Normally it will have been started, but listeners are free to inspect the server and
Expand Down

0 comments on commit f52cdf1

Please sign in to comment.