public ConfigurableApplicationContext run(String... args) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
ConfigurableApplicationContext context = null;
CollectionSpringBootExceptionReporter> exceptionReporters = new ArrayList>();
configureHeadlessProperty();
SpringApplicationRunListeners listeners = getRunListeners(args);
listeners.starting();
try {
ApplicationArguments applicationArguments = new DefaultApplicationArguments(args);
ConfigurableEnvironment environment = prepareEnvironment(listeners, applicationArguments);
configureIgnoreBeanInfo(environment);
Banner printedBanner = printBanner(environment);
context = createApplicationContext();
exceptionReporters = getSpringFactoriesInstances(SpringBootExceptionReporter.class,
new Class[] { ConfigurableApplicationContext.class }, context);
prepareContext(context, environment, listeners, applicationArguments, printedBanner);
refreshContext(context);
afterRefresh(context, applicationArguments);
stopWa服务器托管网tch.stop();
if (this.logStartupInfo) {
new StartupInfoLogger(this.mainApplicationClass).logStarted(getApplicationLog(), stopWatch);
}
listeners.started(context);
callRunners(context, applicationArguments);
}
catch (Throwable ex) {
handleRunFailure(context, ex, exceptionReporters, listeners);
throw new IllegalStateException(ex);
}
try {
listeners.running(context);
}
catch (Throwable ex) {
handleRunFailure(context, ex, exceptionReporters, null);
throw new IllegalStateException(ex);
}
return context;
}
- createApplicationContext 加载各种PostProcessor
- prepareContext 加载ServerMain类
- refreshContext 调用 1步加载的PostProcessor然后实例化
- PostProcessor实例化后就去加载其他的类,生成Beandefinition
ConfigurationClassPostProcessor
PostProcessorRegis服务器托管网trationDelegate#invokeBeanFactoryPostProcessors
ClassPathScanningCandidateComponentProvider
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
相关推荐: 【Azure Key Vault】在Azure Databricks上获取Azure Key Vault中所存储的机密(secret)的两种方式
问题描述 在Azure Databricks上获取Azure Key Vault中所存储的机密(secret)的两种方式? 问题解答 方式一: 在Databricks的Notebook 中,直接编写Python代码读取Key Vault的Secret 实例代码…