user7780894
user7780894

Reputation:

What is hot refresh?

Here is a snippet from Spring Framework Core from 1.6.1: Lifecycle Callbacks:

Also, please note that stop notifications are not guaranteed to come before destruction. On regular shutdown, all Lifecycle beans first receive a stop notification before the general destruction callbacks are being propagated. However, on hot refresh during a context’s lifetime or on aborted refresh attempts, only destroy methods are called.

What is hot refresh? Does it have something to do with live reloading?

Upvotes: 3

Views: 950

Answers (1)

user7780894
user7780894

Reputation:

Answering question by myself.

ContextRefreshedEvent is published when the ApplicationContext is initialized or refreshed (for example, by using the refresh() method on the ConfigurableApplicationContext interface). Here, “initialized” means that all beans are loaded, post-processor beans are detected and activated, singletons are pre-instantiated, and the ApplicationContext object is ready for use. As long as the context has not been closed, a refresh can be triggered multiple times, provided that the chosen ApplicationContext actually supports such “hot” refreshes. For example, XmlWebApplicationContext supports hot refreshes, but GenericApplicationContext does not.

AbstractRefreshableWebApplicationContext:

Provides a "configLocations" property, to be populated through the ConfigurableWebApplicationContext interface on web application startup.

It is the web application context whose config locations property is being replaced without restarting the app.

Upvotes: 2

Related Questions