注:分析的版本是1.4.8。git
圖1 SpringApplication.run的時序圖github
圖1的原圖在Github上。spring
- 步驟1是調用SpringApplication的靜態run方法(步驟1),這個方法會實例化一個SpringApplication(步驟3),並調用SpringApplication的另外一個run方法(步驟8)。
- 步驟13。SpringBoot啓動時,會打印出"SpringBoot",咱們能夠修改打印出來的內容,好比有時會看到佛祖......這個在步驟13中。
- 步驟18。若是看過Spring的applicationContext的源碼,那麼應該知道步驟18中在作些什麼。
有不少地方,仍是不理解,待後面慢慢完善吧!springboot
Reference:
1.Springboot-1.4.8的Github:https://github.com/spring-projects/spring-boot/tree/1.4.xapp