AbstractPrototypeBasedTargetSource.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:lams 作者:
/**
 * Subclasses should call this method to destroy an obsolete prototype instance.
 * @param target the bean instance to destroy
 */
protected void destroyPrototypeInstance(Object target) {
    if (this.logger.isDebugEnabled()) {
        this.logger.debug("Destroying instance of bean '" + getTargetBeanName() + "'");
    }
    if (getBeanFactory() instanceof ConfigurableBeanFactory) {
        ((ConfigurableBeanFactory) getBeanFactory()).destroyBean(getTargetBeanName(), target);
    }
    else if (target instanceof DisposableBean) {
        try {
            ((DisposableBean) target).destroy();
        }
        catch (Throwable ex) {
            logger.error("Couldn't invoke destroy method of bean with name '" + getTargetBeanName() + "'", ex);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号