当前位置:网站首页>Beanfactory creation process
Beanfactory creation process
2022-06-30 04:34:00 【Leisurely summer】
1、 obtain BeanFactory Sub process

2、BeanDefinition Load analysis and registration sub process
2.1、 This sub process involves the following key steps
Resource location : Pointing right BeanDefinition Resource location process . Generally speaking, it is to find the definition Javabean The information of XML file , And encapsulate it as Resource object .
BeanDefinition load : User defined Javabean Expressed as IoC The data structure inside the container , The data structure inside the container is BeanDefinition.
register BeanDefinition To IoC Containers
2.2、 process analysis
Step 1: Sub process entry AbstractRefreshableApplicationContext#refreshBeanFactory In the method
Step 2: Calling multiple classes in turn loadBeanDefinitions Method —> AbstractXmlApplicationContext —>
AbstractBeanDefinitionReader —> XmlBeanDefinitionReader Until XmlBeanDefinitionReader Of doLoadBeanDefinitions Method
Step 3: We focus on XmlBeanDefinitionReader Class registerBeanDefinitions Method , Multiple overloaded calls occurred during , Let's go to the last

Here we focus on two places :⼀ individual createRederContext Method ,⼀ Yes DefaultBeanDefinitionDocumentReader Class registerBeanDefinitions Method , Enter the first createRederContext Methods take a look at

We can see , here Spring ⾸ It's done first NamespaceHandlerResolver The initialization .
Let's go back to registerBeanDefinitions Method to track , Called DefaultBeanDefinitionDocumentReader#registerBeanDefinitions Method

Get into doRegisterBeanDefinitions Method

Get into parseBeanDefinitions Method

Get into parseDefaultElement Method

Get into processBeanDefinition Method

thus , End of registration process , We found that , The so-called registration is to encapsulate XML As defined in Bean The information is encapsulated as BeanDefinition Put after object ⼀ individual Map in ,BeanFactory In order to Map The structure of organizing these BeanDefinition Of .

Can be in DefaultListableBeanFactory See this in Map The definition of
/** Map of bean definition objects, keyed by bean name. */
private final Map<String, BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<>(256);2.3、 Sequence diagram

边栏推荐
- internship:接口案例实现
- Serializable and Deserialize
- Enlist soldiers and generals, draw small programs, multi-threaded display time
- Differences between beanfactory and factorybean
- Enter the date format string as the production date of the commodity, and enter the shelf life (days); Calculate the number of days until today before the expiration date of the product. 1. Change the
- Code cloud fatal: authentication failed for
- Directory operations and virtual file systems
- 【WEBRTC】ADM: rtc_include_internal_audio_device 触发 RTC_DCHECK(adm) 断言
- SQL append field
- Implementation steps of dynamic proxy
猜你喜欢

Threejs realizes the simulation of river, surface flow, pipe flow and sea surface

Directory operations and virtual file systems
![Tea mall system based on SSM framework [project source code + database script + report]](/img/d9/0a46c0da9839a7186bd3a9ae55f0a5.png)
Tea mall system based on SSM framework [project source code + database script + report]

El upload upload file (manual upload, automatic upload, upload progress)

Interview topic of MySQL

史上最全的Redis基础+进阶项目实战总结笔记

基于ROS的SLAM建图、自动导航、避障(冰达机器人)

基于SSM框架茶叶商城系统【项目源码+数据库脚本+报告】

FortiGate firewall configuration log uploading regularly

How the FortiGate firewall rejects a port by using the local in policy policy
随机推荐
7-3 single source shortest circuit for strange play upgrade
My idea configuration
Servlet lifecycle
FortiGate performs DNAT mapping, and intranet users cannot normally access the mapping
FortiGate firewall configuration log uploading regularly
Named pipes for interprocess communication
FortiGate firewall quick initialization administrator password
el-upload上传文件(手动上传,自动上传,上传进度)
Es2019 key summary
Difference between TCP three handshakes and four waves and tcp/udp
Matlab reads fig file and restores signal
El upload upload file (manual upload, automatic upload, upload progress)
Qt Creator 8 Beta2发布
Dual domain SSL certificate
Iterator of JS
FortiGate firewall modifies the default timeout of a session
After the win10 system uses the browser to download, the content is moved or deleted without reason
OneNote software
数据链路层详解
File system and directory operations