- 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 postProcessBeforeInitialization() 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.
Java-Friend has articles on Java, J2EE, Java SCJP Dumps, Core Java Concepts, Java eBooks, Java Database Connectivity (JDBC) , Java Servlets , Java server Pages (JSP) , Java Versions, Struts Framework, Hibernate , WebLogic Application Server, Swings, Spring Framework , AJAX , JMS , Enterprise Java Beans (EJB) , Java Script. Also get Java faqs, Interview Questions.
Friday, June 28, 2013
Bean lifecycle in Spring framework
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment