@OverrideprotectedvoidloadBeanDefinitions(DefaultListableBeanFactory beanFactory)throwsBeansException,IOException{
// Create a new XmlBeanDefinitionReader for the given BeanFactory.// 注意这里BeanFactory作为参数XmlBeanDefinitionReader beanDefinitionReader =newXmlBeanDefinitionReader(beanFactory);// Configure the bean definition reader with this context's// resource loading environment.
beanDefinitionReader.setEnvironment(this.getEnvironment());
beanDefinitionReader.setResourceLoader(this);
beanDefinitionReader.setEntityResolver(newResourceEntityResolver(this));// Allow a subclass to provide custom initialization of the reader,// then proceed with actually loading the bean definitions.initBeanDefinitionReader(beanDefinitionReader)