创建BeanFactory的方法

  @Override
protected final void refreshBeanFactory() throws BeansException {
    if (hasBeanFactory()) {
        destroyBeans();
        closeBeanFactory();
    }
    try {
                //创建IoC容器,这里使用的是DefaultListableBeanFactory    
         DefaultListableBeanFactory beanFactory = createBeanFactory();
               //
        beanFactory.setSerializationId(getId());
        customizeBeanFactory(beanFactory);
               //启动对BeanDefintion的载入    
        loadBeanDefinitions(beanFactory);
        synchronized (this.beanFactoryMonitor) {
            this.beanFactory = beanFactory;
        }
    }
    catch (IOException ex) {
        throw new ApplicationContextException("I/O error parsing bean definition source for " + getDisplayName(), ex);
    }
}
上一篇:【WebSocket No.3】使用WebSocket协议来做服务器


下一篇:Vue.js的main.js的示例