What are the different types of events in the Spring framework

What are the different types of events in the Spring framework





What are the different types of events in the Spring framework

Spring provides the following five standard events:

  1. Context update event (ContextRefreshedEvent): It is triggered when the refresh() method in the ConfigurableApplicationContext interface is called.
  2. Context Start Event (ContextStartedEvent): This event is triggered when the container calls the Start() method of ConfigurableApplicationContext to start/restart the container.
  3. Context stop event (ContextStoppedEvent): This event is triggered when the container calls the Stop() method of ConfigurableApplicationContext to stop the container.
  4. Context closed event (ContextClosedEvent): This event is triggered when the ApplicationContext is closed. When a container is shut down, all singleton beans it manages are destroyed.
  5. Request Handled Event (RequestHandledEvent): In a web application, this event is triggered when an http request (request) ends.
    If a bean implements the ApplicationListener interface, the bean is automatically notified when an ApplicationEvent is published.

insert image description here






My Github address , welcome everyone to join my open source project, or (contact me on my homepage) to join your open source project, click Github-Stars.

\ open source project name dependent type version number describe
1 spring-boot-starter-trie pom 1.0.0-SNAPSHOT The query speed under specific requirements far exceeds that of open source search tools, and the B+ tree under innodb or the inverted index in ES cannot compare with it.
2 spring-boot-starter-trie jar 1.0.0-M1 Provides SpringCloud-based service nodes, which can be used for service discovery through the Nacos registry, realizing dynamic expansion and contraction of the tree, and dynamic online and offline services.
3 Data-Provider pom 1.0.0-SNAPSHOT It provides queries from multiple data sources and data type synchronization. As a Jar, it can rely on dynamically providing data on other services.

Guess you like

Origin blog.csdn.net/jj89929665/article/details/130884279