Different types of events in the spring framework

Source: Internet
Author: User
Tags event listener

Contextrefreshedevent,applicationcontext initialization or update is triggered, the refresh () method in the Configurableapplicationcontext interface is invoked to trigger

The start () method in the Contextstartedevent,,configurableapplicationcontext interface is invoked to trigger

The Stop () method in the Contextstoppededevent,,configurableapplicationcontext interface is invoked to trigger

This event is triggered when Contextclosedevent,appliactioncontext is closed, and all container-managed singleton beans are destroyed.

Requesthandledevent, this event is triggered when an HTTP request ends

If a bean implements the Applicationlistener interface, when a applicationevent is released, it iterates through all the listeners, and for each listener, it can actually get the listener event, but whether or not it is handled is determined by the event listener. If you want to process, use the Onapplicationevent () method to handle the listener

Custom listener events require the Applicationevent interface, ApplicationContext use the Publishevent () method to publish the event.

Different types of events in the spring framework

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.