InitializingBean and DisposableBean, Custom init-method and custom destroy-method
- 25th Jan 2016
- 1
- 12920
- init and destroy methods of bean init and destroy methods of bean with example life cycle methods life cycle methods in spring with example spring bean life cycle methods
InitializingBean interface has one method afterPropertiesSet() which is called after all the properties of a bean are set. DisposableBean interface has one method destroy() which is called before the bean gets destroyed or before it gets removed from the application context. Let us write a UserService class which implements above interfaces package com.kb.beans; import […]