What is the typical Bean life cycle in Spring Bean Factory Container?
Submitted by: AdministratorBean life cycle in Spring Bean Factory Container is as follows:
► The spring container finds the bean's definition from the XML file and instantiates the bean.
► Using the dependency injection, spring populates all of the properties as specified in the bean definition
► If the bean implements the BeanNameAware interface, the factory calls setBeanName() passing the bean's ID.
► If the bean implements the BeanFactoryAware interface, the factory calls setBeanFactory(), passing an instance of itself.
► If there are any BeanPostProcessors associated with the bean, their post- ProcessBeforeInitialization() methods will be called.
► If an init-method is specified for the bean, it will be called.
► Finally, if there are any BeanPostProcessors associated with the bean, their postProcessAfterInitialization() methods will be called.
Submitted by: Administrator
► The spring container finds the bean's definition from the XML file and instantiates the bean.
► Using the dependency injection, spring populates all of the properties as specified in the bean definition
► If the bean implements the BeanNameAware interface, the factory calls setBeanName() passing the bean's ID.
► If the bean implements the BeanFactoryAware interface, the factory calls setBeanFactory(), passing an instance of itself.
► If there are any BeanPostProcessors associated with the bean, their post- ProcessBeforeInitialization() methods will be called.
► If an init-method is specified for the bean, it will be called.
► Finally, if there are any BeanPostProcessors associated with the bean, their postProcessAfterInitialization() methods will be called.
Submitted by: Administrator
Read Online Spring Framework Job Interview Questions And Answers
Top Spring Framework Questions
| ☺ | What do you mean by Auto Wiring? |
| ☺ | What do you mean by Bean wiring? |
| ☺ | What are the advantages of Spring framework? |
| ☺ | How many modules are there in Spring? What are they? |
| ☺ | What are the different types of AutoProxying? |
Top Java Programming Language Categories
| ☺ | Core Java Interview Questions. |
| ☺ | Hibernate Interview Questions. |
| ☺ | Advanced Java Interview Questions. |
| ☺ | IBM WebSphere Interview Questions. |
| ☺ | Spring Framework Interview Questions. |
