SpringBoot应用启动流程

Catalogue

bootstrap and launch a Spring application from a Java main method. By default class will perform the following steps to bootstrap your application:

  • Create an appropriate {@link ApplicationContext} instance (depending on your classpath)
  • Register a {@link CommandLinePropertySource} to expose command line arguments as Spring properties
  • Refresh the application context, loading all singleton beans
  • Trigger any {@link CommandLineRunner} beans
1
2
3
4
5
6
7
8
9
10
/**
* Run the Spring application, creating and refreshing a new
* {@link ApplicationContext}.
* @param args the application arguments (usually passed from a Java main method)
* @return a running {@link ApplicationContext}
*/
public ConfigurableApplicationContext run(String... args) {

}

ConfigurableApplicationContext

SpringBoot启动原理解析

Spring Boot:启动原理解析