首页 > 编程语言 > 详细

SpringBoot启动过程之web,servlet/filter等

时间:2020-08-12 14:26:43      阅读:108      评论:0      收藏:0      [点我收藏+]

最近调试springboot的启动过程.看各种事件.

 

ServletWebServerApplicationContext.onRefresh
-->createWebServer()
-->this.webServer = factory.getWebServer(getSelfInitializer());
-->getSelfInitializer()
-->selfInitialize

ServletWebServerApplicationContext.selfInitialize
-->ServletWebServerApplicationContext.getServletContextInitializerBeans
-->ServletContextInitializerBeans.ServletContextInitializerBeans()
-->ServletContextInitializerBeans.addServletContextInitializerBeans
-->ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializer)
-->beanFactory.getBeanNamesForType(type-->ServletContextInitializer) 
这个返回各种filter的名字.就是filter加载位置
//////////////////////////////////////////////////////////////////////
// 这一段, md, 谁能看懂.
boolean matchFound = (allowEagerInit || !isFactoryBean || (dbd != null && !mbd.isLazyInit()) || containsSingleton(beanName)) && (includeNonSingletons || (dbd != null ? mbd.isSingleton() : isSingleton(beanName))) && isTypeMatch(beanName, type); if (!matchFound && isFactoryBean) { // In case of FactoryBean, try to match FactoryBean instance itself next. beanName = FACTORY_BEAN_PREFIX + beanName; matchFound = (includeNonSingletons || mbd.isSingleton()) && isTypeMatch(beanName, type); } if (matchFound) { result.add(beanName); }

看不出有啥特征, servlet之类的.

技术分享图片

 

SpringBoot启动过程之web,servlet/filter等

原文:https://www.cnblogs.com/tekikesyo/p/13490100.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!