How is event handling done in Spring?

Technology CommunityCategory: SpringHow is event handling done in Spring?
VietMX Staff asked 3 years ago

Event handling in the ApplicationContext is provided through the ApplicationEvent class and ApplicationListener interface. So if a bean implements the ApplicationListener, then every time an ApplicationEvent gets published to the ApplicationContext, that bean is notified.