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);
    }
    }
  • 相关阅读:
    CentOS下MySQL的彻底卸载
    cent 7.0 安装mysql
    centos 安装mysql Package: akonadi-mysql-1.9.2-4.el7.x86_64 (@anaconda)
    使用注解配置SQL映射器
    bean
    转:最简日志打印规范
    快速搭建sonar代码质量管理平台
    (转)Where与Having的总结
    一个问题,日后会写为什么贴出来
    hive Tutorial
  • 原文地址:https://www.cnblogs.com/qfxydtk/p/8078584.html
Copyright © 2011-2022 走看看