Spring's Bean life cycle?

Spring's Bean life cycle includes the following stages:

  1. Instantiation: At this stage, the Spring container creates an instance of the Bean through the reflection mechanism.

  2. Property setting: At this stage, the Spring container sets the properties of the Bean.

  3. Initialization: At this stage, the Spring container calls the Bean's initialization method, if defined.

  4. Use: In this phase, the Spring container provides the Bean for use by the application.

  5. Destruction: At this stage, the Spring container calls the Bean's destruction method, if defined.

Guess you like

Origin blog.csdn.net/weixin_35754962/article/details/129563413