com.interface21.beans.factory
Interface ListableBeanFactory

All Superinterfaces:
BeanFactory
All Known Subinterfaces:
ApplicationContext, WebApplicationContext
All Known Implementing Classes:
ListableBeanFactoryImpl, StaticListableBeanFactory, JdbcBeanFactory

public interface ListableBeanFactory
extends BeanFactory

Extension of BeanFactory 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.
With the exception of getBeanDefinitionCount(), the methods in this interface are not design for frequent invocation. Implementations may be slow.
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", by Rod Johnson.

Since:
16 April 2001
Author:
Rod Johnson

Method Summary
 int getBeanDefinitionCount()
          Return the number of beans defined in the factory
 java.lang.String[] getBeanDefinitionNames()
          Return the names of all beans defined in this factory
 java.lang.String[] getBeanDefinitionNames(java.lang.Class type)
          Return the names of beans matching the given object type (including subclasses).
 
Methods inherited from interface com.interface21.beans.factory.BeanFactory
getAliases, getBean, getBean, isSingleton
 

Method Detail

getBeanDefinitionCount

public int getBeanDefinitionCount()
Return the number of beans defined in the factory
Returns:
the number of beans defined in the factory

getBeanDefinitionNames

public java.lang.String[] getBeanDefinitionNames()
Return the names of all beans defined in this factory
Returns:
the names of all beans defined in this factory. Returns the empty String[], rather than null, if no beans are defined.

getBeanDefinitionNames

public java.lang.String[] getBeanDefinitionNames(java.lang.Class type)
Return the names of beans matching the given object type (including subclasses).
Parameters:
type - class or interface to match
Returns:
the names of beans matching the given object type (including subclasses). Never returns null.


Rod Johnson and Spring contributors 2001-2003.