zoukankan      html  css  js  c++  java
  • 测试spring源码摘取

    首次加载idea是真的慢。。。

    也许是我电脑性能太差。。。

    我分析他内部有一套索引的机制,需要每次打开现建立。。。

    没有固态的话,首次打开还不如eclipse

    第一次使用博客园,以前都在csdn混~

    所以发一段spring ioc源码,测试一下博客园的代码编辑功能是否好用~~~

    此段源码为ioc中refresh起始方法中,创建beanFactory的源码,也是从refresh开始

    ioc开始分3步加载

    1、资源定位;

    2、loadBeanDefinitions-->即将xml配置文件解析的bean及其属性在spring自己定义的数据结构中,然后存放在一个currentHashMap中以供访问。

    3、最后在getBean时才是真正的依赖注入过程哈哈哈。

    /**
    * This implementation performs an actual refresh of this context's underlying
    * bean factory, shutting down the previous bean 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);
    }
    }
  • 相关阅读:
    iaas,paas,saas理解
    July 06th. 2018, Week 27th. Friday
    July 05th. 2018, Week 27th. Thursday
    July 04th. 2018, Week 27th. Wednesday
    July 03rd. 2018, Week 27th. Tuesday
    July 02nd. 2018, Week 27th. Monday
    July 01st. 2018, Week 27th. Sunday
    June 30th. 2018, Week 26th. Saturday
    June 29th. 2018, Week 26th. Friday
    June 28th. 2018, Week 26th. Thursday
  • 原文地址:https://www.cnblogs.com/qfxydtk/p/8078584.html
Copyright © 2011-2022 走看看