public
interfaceListableBeanFactory
extends
BeanFactory
Overview
Inheritance
Members
Usage
Source
Books
Since16 April 2
VersionNot specified.
Author(s)Rod Johnson, Juergen Hoeller
Extension of the BeanFactory interface to be implemented by bean factories
that can enumerate all their bean instances, rather than attempting bean lookup
by name one by one as requested by clients. BeanFactory implementations that
preload all their beans (for example, DOM-based XML factories) may implement
this interface. This interface is discussed in "Expert One-on-One J2EE Design
and Development", by Rod Johnson.
If this is a HierarchicalBeanFactory, the return values will not take
any BeanFactory hierarchy into account, but will relate only to the beans defined
in the current factory. Use the BeanFactoryUtils helper class to consider beans
in ancestor factories too.
The methods in this interface will just respect bean definitions of this factory.
They will ignore any singleton beans that have been registered by other means like
ConfigurableBeanFactory's registerSingleton method, with the exception
of getBeanNamesOfType and getBeansOfType which will check
such manually registered singletons too. Of course, BeanFactory's getBean
does allow transparent access to such special beans as well. However, in typical
scenarios, all beans will be defined by external bean definitions anyway, so most
applications don't need to worry about this differentation.
With the exception of getBeanDefinitionCount and
containsBeanDefinition, the methods in this interface are
not designed for frequent invocation. Implementations may be slow.
If this is a HierarchicalBeanFactory, the return values will not take any BeanFactory hierarchy into account, but will relate only to the beans defined in the current factory. Use the BeanFactoryUtils helper class to consider beans in ancestor factories too.
The methods in this interface will just respect bean definitions of this factory. They will ignore any singleton beans that have been registered by other means like ConfigurableBeanFactory's
registerSingletonmethod, with the exception ofgetBeanNamesOfTypeandgetBeansOfTypewhich will check such manually registered singletons too. Of course, BeanFactory'sgetBeandoes allow transparent access to such special beans as well. However, in typical scenarios, all beans will be defined by external bean definitions anyway, so most applications don't need to worry about this differentation.With the exception of
getBeanDefinitionCountandcontainsBeanDefinition, the methods in this interface are not designed for frequent invocation. Implementations may be slow.