There are several Interfaces to change the behavior of your bean in the container like InitializingBean and DisposableBean Interfaces. Implementing these interfaces will result in the container calling afterPropertiesSet()and destroy()to allow the bean to perform certain actions for initialization and destruction.