备战面试日记(4.2.11)- (框架.Spring【十一】之Spring IOC 源码onRefresh())

本人本科毕业,21届毕业生,一年工作经验,简历专业技能如下,现根据简历,并根据所学知识复习准备面试。

记录日期:2022.1.4

大部分知识点只做大致介绍,具体内容根据推荐博文链接进行详细复习。

框架原理 - Spring(十一)之Spring IOC 源码onRefresh()

AbstractApplicationContext#onRefresh()

是个空壳方法,在AbstractApplicationContext上下文中没有实现,可能在spring后面的版本会去扩展。
看代码可知,与Web上下文有关。

/** * Template method which can be overridden to add context-specific refresh work. * Called on initialization of special beans, before instantiation of singletons. * <p>This implementation is empty. * @throws BeansException in case of errors * @see #refresh() */
protected void onRefresh() throws BeansException {
   
    // For subclasses: do nothing by default.
}

看了StaticWebApplicationContextAbstractRefreshableWebApplicationContextGenericWebApplicationContext的实现都是一样的代码用于初始化主题。

全部评论

相关推荐

11-04 22:56
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务