Java Introduction to Mastery--framework of Spring source analysis spring two core classes

Source: Internet
Author: User
Tags xml reader

First, Spring Core class overview.
There are two core classes in spring which is the most important part of spring implementation.

< Span style= "font-size:18px" > 1, defaultlistablebeanfactory

        This class is located under the Org.springframework.beans.factory.support package under the Beans project.

        Xmlbeanfactory (located in the Org.springframework.beans.factory.xml package) inherits from Defaultlistablebeanfactory, and defaultlistablebeanfactory is the whole bean plus The core part of the download is the default implementation of spring registering the load bean, The difference between xmlbeanfactory and Defaultlistablebeanfactory is that the custom XML reader Xmlbeandefinitionreader is used in Xmlbeanfactory, Enables personalized Beandefinitionreader reads, Defaultlistablebeanfactory inherited the Abstractautowirecapablebeanfactory and realized Configurablelistablebeanfactory and BEANDEFINITIONREGISTR Y interface.

2, Xmlbeandefinitionreader
This class is located under the Org.springframework.beans.factory.xml package.
The reading of the XML configuration file is an important feature in spring, because most of the functionality of spring is based on the configuration file as a pointcut. Then we can set up the function of resource file reading, parsing and registering from Xmlbeandefinitionreader.

Second, two major core class hierarchy chart.

1, Defaultlistablebeanfactory


It is not difficult to find out how this class is packaged from the bottom down step by step.

Here's a general introduction to the role of the main classes:

Aliasregistry: Simple additions and deletions to Alias

Simplealiasregistry: The main use of map as alias cache, and interface Aliasregistry implementation

Singlegtonbeanregistry: Defines the registration and acquisition of the Singleton.

Beanfactory: Defines a variety of properties for the bean and bean.

Defaultsingletonbeanregistry: The implementation of the various functions of interface singlegtonbeanregistry.

Hiberarchicalbeanfactory: Integrated beanfactory with parentfactory support for beanfactory functionality.

Beandefiniregistry: Define the various additions and deletions of the beandefinition operation.

Factorybeanregistrysuppourt: The special treatment of Factorybean was added on the basis of defaultsingletonbeanregistry.

Congfigurablebeanfactory: Provides various methods for configuring factory.

Listablebeanfactory: Gets the configuration list of the bean based on various conditions.

Abstractbeanfactory: Combines the functions of Factorybeanregistrysuppourt and congfigurablebeanfactory.

Autowirecapablebeanfacotry: Provides a post-processor to create beans, auto-inject, initialize, and apply beans.

Abstractautowirecapablebeanfactory: Integrated abstractbeanfactory and implementation of interface Autowirecapablebeanfactory

Configurablelistablebeanfactory:beanfactory configuration checklist, specifying the green type and interface Defaultlistablebeanfactory: Combines all of the above functional groups to be processed after the bean is registered

2.XmlBeanDefinitionReader


From this diagram we can see how this class is packaged in a step-by-step way.

I would like to briefly say a few of the main classes have some features:

Resourceloader: Defines the resource loader, which is primarily used to return the corresponding resource based on the given resource file address.

Beandefinitionredader: The main definition of the resource file reads and translates into the various functions of beandefinition.

Documentloder: Defines the ability to load from a resource file to a converted document.

Third, summary.

This blog is about the two core classes, the following series of blogs will explain in detail how these classes are implemented internally.

Java Introduction to Mastery--framework of Spring source analysis spring two core classes

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.