The life cycle interpretation of Bean in spring

Source: Internet
Author: User

The beans in the spring container have a distinct life cycle consisting of several specific life stages, each of which allows the outside to exert control over the bean. In spring, we describe the bean's life cycle from the scope of the bean and the series of stages it undergoes to instantiate the bean:

The life cycle of the bean in Beanfactory

Simple can be divided into three categories
1.The Bean's Own method (invoking the Bean's constructor to instantiate the bean, invoking the setter method to set the Bean's property value, and the Init-method and Destory-method methods of the bean through the configuration file)

2.Bean life Cycle Interface Methods (Beannameaware,beanfactoryaware,initializaingbean and Disposablebean)

3. container and life cycle structure method (green box section)

The life cycle of the bean in ApplicationContext

The life cycle interpretation of Bean in spring

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.