1.)SpringBoot应用启动运行run方法
2.、refreshContext(context);SpringBoot刷新IOC容器【创建IOC容器对象,并初始化容器,创建容器中的每一个组件】;如果是web应用创建**AnnotationConfigEmbeddedWebApplicationContext**,否则:**AnnotationConfigApplicationContext**
3)、refresh(context);**刷新刚才创建好的ioc容器;**
4)、 onRefresh(); web的ioc容器重写了onRefresh方法
5)、webioc容器会创建嵌入式的Servlet容器;**createEmbeddedServletContainer**();
**6)、获取嵌入式的Servlet容器工厂:**
从ioc容器中获取EmbeddedServletContainerFactory 组件;**TomcatEmbeddedServletContainerFactory**创建对象,后置处理器一看是这个对象,就获取所有的定制器来先定制Servlet容器的相关配置;
7)、**使用容器工厂获取嵌入式的Servlet容器**:this.embeddedServletContainer = containerFactory .getEmbeddedServletContainer(getSelfInitializer());
8)、嵌入式的Servlet容器创建对象并启动Servlet容器;
**先启动嵌入式的Servlet容器,再将ioc容器中剩下没有创建出的对象获取出来;**
**==IOC容器启动创建嵌入式的Servlet容器==**