Spring / Spring Beans
Explain the important life-cycle methods of a bean in Spring framework.
There are 2 important bean lifecycle methods.
The setup method called when the bean is loaded into the container.
The teardown method which is invoked when the bean is unloaded from the container.
The bean XML tag has two important attributes init-method and destroy-method to define your custom initialization and destroy methods. There are also the equivalent annotations @PostConstruct and @PreDestroy.
More Related questions...