onRefresh()
/**
* 可以被重写添加特殊上下文刷新工作的模板代码
* 在实例化单例对象之前,特殊bean初始化时被调用
* 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.
}
这是一个空方法,留给子类自己实现的,在实例化bean之前做一些ApplicationContext的相关操作,比如主题初始化等