接上

164 阅读1分钟

第四步:Spring容器前置处理 this.prepareContext(context, environment, listeners, applicationArguments, printedBanner);

 // 第五步:刷新容器
	this.refreshContext(context);

 // 第六步:Spring容器后置处理
	this.afterRefresh(context, applicationArguments);
	stopWatch.stop();
	if(this.logStartupInfo) {
		(new StartupInfoLogger(this.mainApplicationClass))

.logStarted(this.getApplicationLog(), stopWatch); } // 第七步:发出结束执行的事件 listeners.started(context);

 // 返回容器
	this.callRunners(context, applicationArguments);
} catch (Throwable var10) {
	this.handleRunFailure(context, var10, exceptionReporters, listeners);
	throw new IllegalStateException(var10);
}
try {
	listeners.running(context);
	return context;
} catch (Throwable var9) {
	this.handleRunFailure(context, var9, exceptionReporters,

(SpringApplicationRunListeners)null); throw new IllegalStateException(var9); } }




这些内容,是从拉勾教育的《Java工程师高薪训练营》里学到的,课程内容非常全面,还有拉勾的内推大厂服务,推荐你也看看。