rose框架剖析

實(shí)現(xiàn)GenericFilterBean的initFilterBean(),對(duì)Rose初始化,在此對(duì)比啟動(dòng)日志和分析框架源碼

[INFO 2016-08-22 18:25:04.852] [resin-48] [] [RoseFilter.initFilterBean] [[init] call 'init/rootContext'] [DEBUG 2016-08-22 18:25:04.853] [resin-48] [] [RoseFilter.initFilterBean] [[init] parameters: ]

準(zhǔn)備上下文環(huán)境 prepareRootApplicationContext()--創(chuàng)建根級(jí)別的ApplicationContext對(duì)象,比如WEB-INF、WEB-INF/classes
jar中的spring配置文件所組成代表的、整合為一個(gè) ApplicationContext 對(duì)象

[INFO 2016-08-22 18:25:04.853] [resin-48] [] [RoseFilter.prepareRootApplicationContext] [[init/rootContext] starting ...]

當(dāng)前存在servletContext,如果是RoseWebAppContext,[init/rootContext] the root context exists,直接return;
當(dāng)前存在servletContext,不是RoseWebAppContex 否則啟動(dòng)失敗,報(bào)錯(cuò)Cannot initialize context because there is already a root application context present,檢查web.xml

確認(rèn)所使用的applicationContext配置,默認(rèn)使用
public static final String DEFAULT_CONFIG_LOCATION = "/WEB-INF/applicationContext*.xml";
設(shè)置servletContext

[INFO 2016-08-22 18:25:13.496] [resin-48] [] [RoseFilter.prepareRootApplicationContext] [[init/rootContext] exits] [INFO 2016-08-22 18:25:13.496] [resin-48] [] [RoseFilter.prepareRootApplicationContext] [[init/rootContext] Published rose.root WebApplicationContext [rose.root: display name [Root WebApplicationContext]; startup date [Mon Aug 22 18:25:04 CST 2016]; root of context hierarchy] as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]]

[INFO 2016-08-22 18:25:13.496] [resin-48] [] [RoseFilter.initFilterBean] [[init] exits from 'init/rootContext'] [INFO 2016-08-22 18:25:13.496] [resin-48] [] [RoseFilter.initFilterBean] [[init] call 'init/module']

識(shí)別rose程序模塊 prepareModules(rootContext)

[INFO 2016-08-22 18:25:23.164] [resin-48] [] [RoseFilter.initFilterBean] [[init] exits from 'init/module'] [INFO 2016-08-22 18:25:23.164] [resin-48] [] [RoseFilter.initFilterBean] [[init] call 'init/mappingTree']

創(chuàng)建匹配樹以及各個(gè)節(jié)點(diǎn)上的執(zhí)行邏輯 prepareMappingTree(modules)

[INFO 2016-08-22 18:25:23.416] [resin-48] [] [RoseFilter.initFilterBean] [[init] exits from 'init/mappingTree'] [INFO 2016-08-22 18:25:23.416] [resin-48] [] [RoseFilter.initFilterBean] [[init] exits from 'init']

打印啟動(dòng)信息printRoseInfos(endTime - startTime)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容