12_完成刷新,发布相应事件

查看全部
// Last step: publish corresponding event.
finishRefresh();

  1. 初始化生命周期处理器,如果有id为lifecycleProcessor的bean,则获取并赋值;否则使用默认的
// Initialize lifecycle processor for this context.
initLifecycleProcessor();
  1. 刷新生命周期处理器,获取刚刚的生命周期处理器,执行onRefresh
// Propagate refresh to lifecycle processor first.
getLifecycleProcessor().onRefresh();
  1. 发布ContextRefreshedEvent(容器刷新完毕事件)
// Publish the final event.
publishEvent(new ContextRefreshedEvent(this));
  1. 注册容器
// Participate in LiveBeansView MBean, if active.
LiveBeansView.registerApplicationContext(this);

你可能感兴趣的:(12_完成刷新,发布相应事件)