In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to initialize Spring Bean", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "how to initialize Spring Bean" this article.
Preface
I have been doing Java for many years, and I have always wondered how Spring initializes bean and how to call reflection instantiated objects. I used to think that the instantiation of spring bean objects has always been done by the BeanPostProcessor interface implementation class, but I just don't know which implementation class.
Three-level cache
Why the interviewer especially likes to ask to create a three-tier cache of bean, mainly because the creation of bean is accompanied by the transition between the three-level cache, and different states of objects are stored in different caches. I will support how objects flow in the cache when analyzing the code below. First, take a look at the spring three-level cache.
/ * * first-level cache is used to store singleton bean, that is, initialization is completed and all dependencies are injected * / private final Map singletonObjects = new ConcurrentHashMap (256); / * second-level cache exposes singleton objects prematurely, when bean has just completed initialization, attribute injection and execution of init method * / private final Map earlySingletonObjects = new ConcurrentHashMap (16) / * * three-level cache loads the factory object that created the bean * / private final Map
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.