除了自定义的destroy-method.还可以实现DisposableBean接口,来回调bean销毁时候执行的方法,这个接口有一个destroy方法,生命周期是是destroy----bean销毁---自定义的destroy方法
SimpleBean.java






































配置文件:




















测试代码:





































结果:
this is info from afterpropertiesSet from SimpleBean
before destroy
this is info from destroy method
this is info from customer destroy method
after destory
http://blog.youkuaiyun.com/daryl715/article/details/1678986