Spring Bean Lifecycle

There are two lifecycle events related to Spring Bean. They are post-initialization and pre-destruction

Post-initialization happens when Spring finishes setting all the properties of the bean and checking all the dependencies of the bean

The pre-desctruction event is fired just before the bean is destroyed by the Spring Container
If your Bean has prototype scope pre-desctruction event will not be fired

Spring has three methods to hook up for these lifecycle events
1 Interface-based
2 Method-based
3 Annotation-based