/**
* Extension of the {@link BeanFactory} interface to be implemented by bean factories 扩展自 BeanFactory 接口,可以枚举通过 bean 工厂实现的所有 bean 实例
* that can enumerate all their bean instances, rather than attempting bean lookup 而不是尝试按照客户的请求通过 name 一个个的查找
* by name one by one as requested by clients. BeanFactory implementations that BeanFactory 可以实现这个接口预加载所有的 bean definition
* preload all their bean definitions (such as XML-based factories) may implement (例如 基于 xml 的工厂)
* this interface.
*
* <p>If this is a {@link HierarchicalBeanFactory}, the return values will <i>not</i> 如果是一个 HierarchicalBeanFactory ,返回值将不考虑所有 BeanFactory 层次结构
* take any BeanFactory hierarchy into account, but will relate only to the beans 但是将仅联系当前的工厂的 bean 定义
* defined in the current factory. Use the {@link BeanFactoryUtils} helper class 使用 BeanFactoryUtils 帮助类也可以考虑祖先工厂的 bean
* to consider beans in ancestor factories too.
*
* <p>The methods in this interface will just respect bean definitions of this factory. 这个接口的方法将仅维护这个 工厂 bean definition
* They will ignore any singleton beans that have been registered by other means like 他们将忽略通过其他方式例如,ConfigurableBeanFactory 的 registerSingleton 方法注册的单例 bean,
* {@link org.springframework.beans.factory.config.ConfigurableBeanFactory}'s 但是 getBeanNamesOfType 和 getBeansOfType 除外,它们将检查手动注册的 bean
* {@code registerSingleton} method, with the exception of
* {@code getBeanNamesOfType} and {@code getBeansOfType} which will check
* such manually registered singletons too. Of course, BeanFactory's {@code getBean} 当然 getBean 也允许公开的访问
* does allow transparent access to such special beans as well. However, in typical 特殊的 bean。然而,经典的场景里,
* scenarios, all beans will be defined by external bean definitions anyway, so most 所有的 bean 被定义将凭借扩展的 bean definition 来定义
* applications don't need to worry about this differentiation. 因此大多数的 applications 不需要担心关于这些区别
*
* <p><b>NOTE:</b> With the exception of {@code getBeanDefinitionCount} 除了 getBeanDefinitionCount 和 containsBeanDefinition ,
* and {@code containsBeanDefinition}, the methods in this interface 这个接口中的方法的设计不是为了频繁的调用,
* are not designed for frequent invocation. Implementations may be slow. 实现可能会很慢
*
* @author Rod Johnson
* @author Juergen Hoeller
* @since 16 April 2001
* @see HierarchicalBeanFactory
* @see BeanFactoryUtils
*/
public interface ListableBeanFactory extends BeanFactory {}
Spring源码-ListableBeanFactory-解读
最新推荐文章于 2025-01-25 11:39:22 发布