@OverridepublicvoidcopyConfigurationFrom(ConfigurableBeanFactory otherFactory) { Assert.notNull(otherFactory,"BeanFactory must not be null"); setBeanClassLoader(otherFactory.getBeanClassLoader()); setCacheBeanMetadata(otherFactory.isCacheBeanMetadata()); setBeanExpressionResolver(otherFactory.getBeanExpression...
Assert.notNull(otherFactory, "BeanFactory must not be null"); setBeanClassLoader(otherFactory.getBeanClassLoader()); setCacheBeanMetadata(otherFactory.isCacheBeanMetadata()); setBeanExpressionResolver(otherFactory.getBeanExpressionResolver()); if (otherFactory instanceof AbstractBeanFactory) { AbstractBe...
notNull(lbf, "ListableBeanFactory must not be null"); String[] result = lbf.getBeanNamesForType(type); // 通过`HierarchicalBeanFactory`类型的工厂继承关系, // 从而达到bean名称统计的目的 if (lbf instanceof HierarchicalBeanFactory) { HierarchicalBeanFactory...
publicvoidaddBeanFactoryPostProcessor(BeanFactoryPostProcessor postProcessor) { Assert.notNull(postProcessor,"BeanFactoryPostProcessor must not be null");this.beanFactoryPostProcessors.add(postProcessor); } 添加后的后处理器会存放在BeanFactoryPostProcessors中,而在处理BeanFactoryPostProcessor时候会首先检测...
notNull(singletonFactory, "Singleton factory must not be null"); synchronized (this.singletonObjects) { // 判断singletonObjects内名字为beanName是否被占用,若没有,进行注册操作 if (!this.singletonObjects.containsKey(beanName)) { this.singletonFactories.put(beanName, singletonFactory); this.early...
Assert.notNull(lbf, "ListableBeanFactory must not be null");Map result = new LinkedHashMap(4);result.putAll(lbf.getBeansOfType(type));if (lbf instanceof HierarchicalBeanFactory) { HierarchicalBeanFactory hbf = (HierarchicalBeanFactory) lbf;if (hbf.getParentBeanFactory() instanceof ...
notNull(handlerMappingsLocation, "Handler mappings location must not be null"); this.classLoader = (classLoader != null ? classLoader : ClassUtils.getDefaultClassLoader()); this.handlerMappingsLocation = handlerMappingsLocation; } 查看spring几个jar包中的META-INF,发现了相应的配置文件s...
Assert.notNull(resources, "Resource array must not be null"); int counter = 0; // 变量资源对象,加载BeanDefinition for (Resource resource : resources) { // 在这里,经过debug,调到XmlBeanDefinitionReader.loadBeanDefinitions(resource) counter += loadBeanDefinitions(resource); ...
Assert.notNull(encodedResource,"EncodedResource must not be null");if(logger.isInfoEnabled()) { logger.info("Loading XML bean definitions from "+ encodedResource.getResource()); }// 通过属性记录已加载的资源Set<EncodedResource> currentResources =this.resourcesCurrentlyBeingLoaded.get();if(current...
Assert.notNull(postProcessor, "BeanFactoryPostProcessor must not be null"); this.beanFactoryPostProcessors.add(postProcessor); } /** * Return the list of BeanFactoryPostProcessors that will get applied * to the internal BeanFactory.