What can Spring Bean containers do during the life cycle of Bean?

BeanPostProcessor defines two methods, postProcessBeforeInitialization and postProcessorAfterInitilazation, while InstantiationAwareBeanPostProcessor defines another pair of post-processing methods. Are postProcessBeforeInstantiation and postProcessAfterInstantiation;
both Initialization and Instantiation part of the Bean life cycle?
what is the difference between the two? Does
have any special uses?

Aug.16,2021

Initialization and Instantiation are both part of the Bean life cycle. The two methods of InstantiationAwareBeanPostProcessor are mainly pre-and post-instantiation methods of object instantiation, and the two methods of its parent interface BeanPostProcessor are mainly called after the object is instantiated, and Instantiation instantiation is executed earlier than Initialization initialization.


Menu