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:
- Context update event (ContextRefreshedEvent): It is triggered when the refresh() method in the ConfigurableApplicationContext interface is called.
- Context Start Event (ContextStartedEvent): This event is triggered when the container calls the Start() method of ConfigurableApplicationContext to start/restart the container.
- Context stop event (ContextStoppedEvent): This event is triggered when the container calls the Stop() method of ConfigurableApplicationContext to stop the container.
- 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.
- 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.
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. |