Spring IoC container is also responsible for managing the Spring Bean Life Cycle, the life cycle of beans consist of call back methods such as Post initialization call back method and Pre destruction call back method. Below steps are followed by Spring IoC Container to manage bean life cycle.
Spring Bean Life Cycle
- Creation of bean instance by a factory method.
- Set the values and bean references to the bean properties.
- Call the initialization call back method.
- Bean is ready for use.
- Call the destruction call back method.