弹簧芯.默认的@Bean销毁方法 [英] Spring core. Default @Bean destroy method
本文介绍了弹簧芯.默认的@Bean销毁方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有自己的豆子:
@Bean
public MyBean myBean(){...
在spring文档发布自己的资源之后,我应该指定destroyMethod
.如果没有直接指定destroyMethod
,我还没有找到spring调用的默认销毁方法.
following spring documentation to release its own resources I should specify destroyMethod
. I've not found any default destroy methods called by spring in case if destroyMethod
is not specified directly.
我用过
@Bean(destroyMethod = "close")
public MyBean myBean(){...
但是请考虑如果默认情况下具有值,则不直接指定destroy方法的可能性.
but think about possibility to do not specify destroy method directly if it has value by default.
spring是否默认尝试使用destroy
,close
,release
之类的东西?
如果spring默认尝试一些方法来释放资源-哪些方法?
Does spring try something by default like destroy
, close
, release
?
If spring tries some methods by default to release resources - which ones?
推荐答案
查看全文