Spring beanFactory produces beans

Step one: call the default constructor of the bean (of course, it can also be the specified other constructor), and generate a bean instance: bean1.

Step 2: Check whether the attribute value of the Bean is injected into the Bean configuration file. If there is injection, inject its attributes on the basis of the bean1 instance, and overwrite the original bean1 to form a new bean instance: bean2.
Step 3: Check whether the Bean implements the InitializingBean interface. If this interface is implemented, call the afterPropertiesSet() method to perform corresponding operations on bean2, and then overwrite bean2 to form a new bean instance: bean3.
Step 4: Check whether the init-method attribute is specified in the Bean configuration file. If so, call the corresponding method of this attribute and perform corresponding operations on bean3, and finally overwrite bean3 to form a new instance: bean4.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325173941&siteId=291194637