文章目录
- 一、版本说明
- 二、SpringBoot运行原理
- 三、@SpringBootApplication
- 四、SpringApplication
-
- 4.1、作用
- 4.2、源码形态
-
- 4.2.1、Method
-
- 4.2.1.1、SpringApplication(Class<?>... primarySources)
- 4.2.1.2、SpringApplication(ResourceLoader resourceLoader, Class<?>... primarySources)
- 4.2.1.3、getBootstrapRegistryInitializersFromSpringFactories()
- 4.2.1.4、deduceMainApplicationClass()
- 4.2.1.5、run(String... args)
- 4.2.1.6、createBootstrapContext()
- 4.2.1.7、prepareEnvironment(SpringApplicationRunListeners listeners, DefaultBootstrapContext bootstrapContext, ApplicationArguments applicationArguments)
- 4.2.1.8、deduceEnvironmentClass()
- 4.2.1.9、prepareContext(DefaultBootstrapContext bootstrapContext, ConfigurableApplicationContext context,ConfigurableEnvironment environment, SpringApplicationRunListeners listeners,ApplicationArguments applicationArguments, Banner printedBanner)
- 4.2.1.10、refreshContext(ConfigurableApplicationContext context)
- 4.2.1.11、configureHeadlessProperty()
- 4.2.1.12、getRunListeners(String [] args)
- 4.2.1.13、getSpringFactoriesInstances(Class<?> type)
- 4.2.1.14、getSpringFactoriesInstances(Class type, Class<?>[] parameterTypes, Object... args)
- 4.2.1.15、createSpringFactoriesInstances(Class type, Class<?>[] parameterTypes, ClassLoader classLoader, Object[] args, Set names)
- 4.2.1.16、getOrCreateEnvironment
- 4.2.1.17、configureEnvironment(onfigurableEnvironment environment, String[] args)
- 4.2.1.18、configurePropertySources(ConfigurableEnvironment environment, String[] args)
- 4.2.1.19、configureProfiles(ConfigurableEnvironment environment, String[] args)
- 4.2.1.20、configureAdditionalProfiles(ConfigurableEnvironment environment)
- 4.2.1.21、configureIgnoreBeanInfo(ConfigurableEnvironment environment)
- 4.2.1.22、bindToSpringApplication(ConfigurableEnvironment environment)
- 4.2.1.23、printBanner(ConfigurableEnvironment environment)
- 4.2.1.24、createApplicationContext()
- 4.2.1.25、postProcessApplicationContext(ConfigurableApplicationContext context)
- 4.2.1.26、applyInitializers(ConfigurableApplicationContext context)
- 4.2.1.27、logStartupInfo(boolean isRoot)
- 4.2.1.28、logStartupProfileInfo(ConfigurableApplicationContext context)
- 4.2.1.29、getApplicationLog()
- 4.2.1.30、load(ApplicationContext context, Object[] sources)
- 4.2.1.31、getResourceLoader()
- 4.2.1.32、getClassLoader()
- 4.2.1.33、getBeanDefinitionRegistry(ApplicationContext context)
- 4.2.1.34、createBeanDefinitionLoader(BeanDefinitionRegistry registry, Object[] sources)
- 4.2.1.35、afterRefresh(ConfigurableApplicationContext context, ApplicationArguments args)
- 4.2.1.36、callRunners(ApplicationContext context, ApplicationArguments args)
- 4.2.1.37、callRunner(ApplicationRunner runner, ApplicationArguments args)
- 4.2.1.38、callRunner(CommandLineRunner runner, ApplicationArguments args)
- 4.2.1.39、handleRunFailure(ConfigurableApplicationContext context, Throwable exception, SpringApplicationRunListeners listeners)
- 4.2.1.40、getExceptionReporters(ConfigurableApplicationContext context)
- 4.2.1.41、reportFailure(Collection exceptionReporters, Throwable failure)
- 4.2.1.42、registerLoggedException(Throwable exception)
- 4.2.1.43、handleExitCode(ConfigurableApplicationContext context, Throwable exception)
- 4.2.1.44、getExitCodeFromException(ConfigurableApplicationContext context, Throwable exception)
- 4.2.1.45、getExitCodeFromMappedException(ConfigurableApplicationContext context, Throwable exception)
- 4.2.1.46、getExitCodeFromExitCodeGeneratorException(Throwable exception)
- 4.2.1.47、getSpringBootExceptionHandler()
- 4.2.1.48、isMainThread(Thread currentThread)
- 4.2.1.49、static run(Class<?> primarySource, String... args)
- 4.2.1.50、static run(Class<?>[] primarySources, String[] args)
- 4.2.1.51、static main(String [] args)
- 4.2.1.52、static exit(ApplicationContext context, ExitCodeGenerator... exitCodeGenerators)
- 4.2.1.53、static close(ApplicationContext context)
- 4.2.1.54、static asUnmodifiableOrderedSet(Collection elements)
- 4.2.2、Class Core
一、版本说明
该文档主要拆解2.4.5版本。