Test-spring Source Code harvesting

Source: Internet
Author: User

First load idea is really slow ...

Perhaps my computer performance is too poor ...

I analyzed his internal set of indexing mechanisms that needed to be opened every time ...

Without solid state, the first turn is not as good as eclipse.

The first time to use the blog park, used to be in the CSDN mixed ~

So send a spring IOC source code, test the blog to see if the coding function of the garden is useful ~ ~ ~

This section of the source code for the IOC in the Refresh Start method, the creation of Beanfactory source code, also from the refresh start

IOC starts to load in 3 steps

1, resource positioning;

2. Loadbeandefinitions--> the bean and its attributes that are parsed by the XML configuration file are in spring's own defined data structure and then stored in a currenthashmap for access.

3, finally in the Getbean is the real dependence injection process hahaha.

/**
* This implementation performs a actual refresh of this context ' s underlying
* Bean factory, shutting down the previous beans factory (if any) and
* Initializing a fresh bean factory for the next phase of the context ' s lifecycle.
*/
@Override
Protected final void Refreshbeanfactory () throws Beansexception {
if (Hasbeanfactory ()) {
Destroybeans ();
Closebeanfactory ();
}
try {
Defaultlistablebeanfactory beanfactory = Createbeanfactory ();
Beanfactory.setserializationid (GetId ());
Customizebeanfactory (beanfactory);
Loadbeandefinitions (beanfactory);
Synchronized (this.beanfactorymonitor) {
This.beanfactory = beanfactory;
}
}
catch (IOException ex) {
throw new Applicationcontextexception ("I/O error parsing bean definition source for" + GetDisplayName (), ex);
}
}

Test-spring Source Code harvesting

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.