Câu hỏi phỏng vấn Spring
Câu hỏi

Describe some of the standard Spring events

Câu trả lời

Standard Spring events are part of the Spring Framework's application event infrastructure which allows for communication between different parts of a Spring application. These events are typically state changes in the lifecycle of the Spring ApplicationContext or specific application-driven events. Here are some of the standard Spring events:

  1. ContextRefreshedEvent: This event is published when the ApplicationContext is either initialized or refreshed. This can also happen when the refresh() method on the ConfigurableApplicationContext interface is invoked.

  2. ContextStartedEvent: This event is published when the ApplicationContext is started using the start() method on the ConfigurableApplicationContext interface, indicating that all the beans are fully loaded, post-processed, and the application is ready to service requests.

  3. ContextStoppedEvent: This event is published when the ApplicationContext is stopped using the stop() method on the ConfigurableApplicationContext interface. It indicates that the context is in a stopped state and cannot service requests.

  4. ContextClosedEvent: This event is published when the ApplicationContext is closed using the close() method on the ConfigurableApplicationContext interface. It indicates that the application context is being shut down and all the singleton beans are destroyed.

  5. RequestHandledEvent: This is a web-specific event telling all beans that an HTTP request has been serviced.

  6. ApplicationEvent: This is the base class for all application-specific events that you can create in your application. These events are typica...

middle

middle

Gợi ý câu hỏi phỏng vấn

expert

Can we use both Web MVC and WebFlux in the same application?

middle

What do you mean by Auto Wiring?

middle

What is Aspect?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào