In this video, shows you how to add custom code while destory beans in the container.
There are 3 ways: DisposableBean, @PreDestroy and Custom Destory method. When you use them, the order is slightly changed.
And if the bean scope is prototype, the destory isn't being called.
source code: https://github.com/TinaXing2012/Spring/tree/master/springbeanlifecycle
Download
0 formats
No download links available.
Spring Bean Lifecycle | Destruction - DisposableBean, @PreDestroy and Custom Destory method | NatokHD