spring:refresh方法之finishRefresh

finishRefresh:

刷新完成工作,包括初始化LifecycleProcessor,發佈刷新完成事件等

源碼:

protected void finishRefresh() {
		// Initialize lifecycle processor for this context.
//初始化生命週期管理器LifecycleProcessor
		initLifecycleProcessor();

		// Propagate refresh to lifecycle processor first.
//啓動所有實現了Lifecycle接口的bean
		getLifecycleProcessor().onRefresh();

		// Publish the final event.
//發佈刷新完成事件
		publishEvent(new ContextRefreshedEvent(this));

		// Participate in LiveBeansView MBean, if active.
		LiveBeansView.registerApplicationContext(this);
	}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章