Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




Java Training: - Can you explain Bean lifecycle in Spring framework?

  • The spring container finds the beans 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

See the following video on Inheritance between beans and Spring in Java: -

Click to get Java Training

Regards,

Get more Java Training from author’s blog

Share this article   |    Print    |    Article read by 3836 times
Author:
Shivprasad Koirala
We conduct training for Java/J2EE technologies like design patterns, J2EE, Struts, Hibernate, Spring, Rich Interface etc. and likes to write articles on the same in free time.
Related Articles: No related article
Related Interview Questions: