• 测试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);
    }
    }
  • 相关阅读:
    仿google的suggest
    renderjs主动发起通讯
    数据库设计原则(转载)
    SqlBulkCopy批量插入
    NPOI使用word模板
    visual studio 2010与NUNIT集成调试
    bond
    linux 内核参数优化
    Linux清除用户登陆及历史命令
    nginx 常用请求
  • 原文地址:https://www.cnblogs.com/qfxydtk/p/8078584.html
Copyright © 2020-2023  润新知