Home » Spring-Framework-090522 » org.springframework » beans » factory » support » [javadoc | source]
org.springframework.beans.factory.support
public class: DefaultListableBeanFactory [javadoc | source]
java.lang.Object
   org.springframework.core.SimpleAliasRegistry
      org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
         org.springframework.beans.factory.support.FactoryBeanRegistrySupport
            org.springframework.beans.factory.support.AbstractBeanFactory
               org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
                  org.springframework.beans.factory.support.DefaultListableBeanFactory

All Implemented Interfaces:
    ConfigurableListableBeanFactory, BeanDefinitionRegistry, AutowireCapableBeanFactory, ConfigurableBeanFactory, SingletonBeanRegistry, AliasRegistry

Direct Known Subclasses:
    XmlBeanFactory

Default implementation of the org.springframework.beans.factory.ListableBeanFactory and BeanDefinitionRegistry interfaces: a full-fledged bean factory based on bean definition objects.

Typical usage is registering all bean definitions first (possibly read from a bean definition file), before accessing beans. Bean definition lookup is therefore an inexpensive operation in a local bean definition table, operating on pre-built bean definition metadata objects.

Can be used as a standalone bean factory, or as a superclass for custom bean factories. Note that readers for specific bean definition formats are typically implemented separately rather than as bean factory subclasses: see for example PropertiesBeanDefinitionReader and org.springframework.beans.factory.xml.XmlBeanDefinitionReader .

For an alternative implementation of the org.springframework.beans.factory.ListableBeanFactory interface, have a look at StaticListableBeanFactory , which manages existing bean instances rather than creating new ones based on bean definitions.

Fields inherited from org.springframework.beans.factory.support.DefaultSingletonBeanRegistry:
NULL_OBJECT,  logger
Constructor:
 public DefaultListableBeanFactory() 
 public DefaultListableBeanFactory(BeanFactory parentBeanFactory) 
    Create a new DefaultListableBeanFactory with the given parent.
    Parameters:
    parentBeanFactory - the parent BeanFactory
Method from org.springframework.beans.factory.support.DefaultListableBeanFactory Summary:
allowAliasOverriding,   containsBeanDefinition,   copyConfigurationFrom,   determinePrimaryCandidate,   findAutowireCandidates,   freezeConfiguration,   getAutowireCandidateResolver,   getBeanDefinition,   getBeanDefinitionCount,   getBeanDefinitionNames,   getBeanNamesForType,   getBeanNamesForType,   getBeansOfType,   getBeansOfType,   isAutowireCandidate,   isAutowireCandidate,   isBeanEligibleForMetadataCaching,   isConfigurationFrozen,   isPrimary,   preInstantiateSingletons,   registerBeanDefinition,   registerResolvableDependency,   removeBeanDefinition,   resetBeanDefinition,   resolveDependency,   setAllowBeanDefinitionOverriding,   setAllowEagerClassLoading,   setAutowireCandidateResolver,   toString
Methods from org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory:
applyBeanPostProcessorsAfterInitialization,   applyBeanPostProcessorsBeforeInitialization,   applyBeanPostProcessorsBeforeInstantiation,   applyBeanPropertyValues,   applyMergedBeanDefinitionPostProcessors,   applyPropertyValues,   autowire,   autowireBean,   autowireBeanProperties,   autowireByName,   autowireByType,   autowireConstructor,   checkDependencies,   configureBean,   copyConfigurationFrom,   createBean,   createBean,   createBean,   createBeanInstance,   determineConstructorsFromBeanPostProcessors,   doCreateBean,   filterPropertyDescriptorsForDependencyCheck,   getEarlyBeanReference,   getInstantiationStrategy,   getTypeForFactoryBean,   getTypeForFactoryMethod,   ignoreDependencyInterface,   ignoreDependencyType,   initializeBean,   initializeBean,   instantiateBean,   instantiateUsingFactoryMethod,   invokeCustomInitMethod,   invokeInitMethods,   isExcludedFromDependencyCheck,   populateBean,   postProcessObjectFromFactoryBean,   predictBeanType,   removeSingleton,   resolveBeforeInstantiation,   resolveDependency,   setAllowCircularReferences,   setAllowRawInjectionDespiteWrapping,   setInstantiationStrategy,   unsatisfiedNonSimpleProperties
Methods from org.springframework.beans.factory.support.AbstractBeanFactory:
addBeanPostProcessor,   addPropertyEditorRegistrar,   afterPrototypeCreation,   beforePrototypeCreation,   checkMergedBeanDefinition,   clearMergedBeanDefinition,   containsBean,   containsBeanDefinition,   containsLocalBean,   copyConfigurationFrom,   createBean,   destroyBean,   destroyBean,   destroyScopedBean,   doGetBean,   getAliases,   getBean,   getBean,   getBean,   getBean,   getBeanClassLoader,   getBeanDefinition,   getBeanPostProcessorCount,   getBeanPostProcessors,   getCustomEditors,   getCustomTypeConverter,   getMergedBeanDefinition,   getMergedBeanDefinition,   getMergedBeanDefinition,   getMergedLocalBeanDefinition,   getObjectForBeanInstance,   getParentBeanFactory,   getPropertyEditorRegistrars,   getRegisteredScope,   getRegisteredScopeNames,   getTempClassLoader,   getType,   getTypeConverter,   getTypeForFactoryBean,   hasDestructionAwareBeanPostProcessors,   hasInstantiationAwareBeanPostProcessors,   initBeanWrapper,   isBeanEligibleForMetadataCaching,   isBeanNameInUse,   isCacheBeanMetadata,   isCurrentlyInCreation,   isFactoryBean,   isFactoryBean,   isPrototype,   isPrototypeCurrentlyInCreation,   isSingleton,   isTypeMatch,   markBeanAsCreated,   originalBeanName,   predictBeanType,   registerCustomEditor,   registerCustomEditor,   registerCustomEditors,   registerDisposableBeanIfNecessary,   registerScope,   removeSingletonIfCreatedForTypeCheckOnly,   requiresDestruction,   resolveBeanClass,   resolveBeanClass,   setBeanClassLoader,   setCacheBeanMetadata,   setParentBeanFactory,   setTempClassLoader,   setTypeConverter,   transformedBeanName
Methods from org.springframework.beans.factory.support.FactoryBeanRegistrySupport:
getCachedObjectForFactoryBean,   getFactoryBean,   getObjectFromFactoryBean,   getTypeForFactoryBean,   postProcessObjectFromFactoryBean,   removeSingleton
Methods from org.springframework.beans.factory.support.DefaultSingletonBeanRegistry:
addSingleton,   addSingletonFactory,   afterSingletonCreation,   beforeSingletonCreation,   containsSingleton,   destroyBean,   destroySingleton,   destroySingletons,   getDependenciesForBean,   getDependentBeans,   getSingleton,   getSingleton,   getSingleton,   getSingletonCount,   getSingletonMutex,   getSingletonNames,   hasDependentBean,   isSingletonCurrentlyInCreation,   onSuppressedException,   registerDependentBean,   registerDisposableBean,   registerSingleton,   removeSingleton
Methods from org.springframework.core.SimpleAliasRegistry:
allowAliasOverriding,   canonicalName,   getAliases,   isAlias,   registerAlias,   removeAlias,   resolveAliases
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.beans.factory.support.DefaultListableBeanFactory Detail:
 protected boolean allowAliasOverriding() 
    Only allows alias overriding if bean definition overriding is allowed.
 public boolean containsBeanDefinition(String beanName) 
 public  void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) 
 protected String determinePrimaryCandidate(Map candidateBeans,
    Class type) 
    Determine the primary autowire candidate in the given set of beans.
 protected Map findAutowireCandidates(String beanName,
    Class requiredType,
    DependencyDescriptor descriptor) 
    Find bean instances that match the required type. Called during autowiring for the specified bean.
 public  void freezeConfiguration() 
 public AutowireCandidateResolver getAutowireCandidateResolver() 
    Return the autowire candidate resolver for this BeanFactory (never null).
 public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException 
 public int getBeanDefinitionCount() 
 public String[] getBeanDefinitionNames() 
 public String[] getBeanNamesForType(Class type) 
 public String[] getBeanNamesForType(Class type,
    boolean includeNonSingletons,
    boolean allowEagerInit) 
 public Map getBeansOfType(Class type) throws BeansException 
 public Map getBeansOfType(Class type,
    boolean includeNonSingletons,
    boolean allowEagerInit) throws BeansException 
 public boolean isAutowireCandidate(String beanName,
    DependencyDescriptor descriptor) throws NoSuchBeanDefinitionException 
 protected boolean isAutowireCandidate(String beanName,
    RootBeanDefinition mbd,
    DependencyDescriptor descriptor) 
    Determine whether the specified bean definition qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
 protected boolean isBeanEligibleForMetadataCaching(String beanName) 
    Considers all beans as eligible for metdata caching if the factory's configuration has been marked as frozen.
 public boolean isConfigurationFrozen() 
 protected boolean isPrimary(String beanName,
    Object beanInstance) 
    Return whether the bean definition for the given bean name has been marked as a primary bean.
 public  void preInstantiateSingletons() throws BeansException 
 public  void registerBeanDefinition(String beanName,
    BeanDefinition beanDefinition) throws BeanDefinitionStoreException 
 public  void registerResolvableDependency(Class dependencyType,
    Object autowiredValue) 
 public  void removeBeanDefinition(String beanName) throws NoSuchBeanDefinitionException 
 protected  void resetBeanDefinition(String beanName) 
    Reset all bean definition caches for the given bean, including the caches of beans that are derived from it.
 public Object resolveDependency(DependencyDescriptor descriptor,
    String beanName,
    Set autowiredBeanNames,
    TypeConverter typeConverter) throws BeansException 
 public  void setAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding) 
    Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former. If not, an exception will be thrown. This also applies to overriding aliases.

    Default is "true".

 public  void setAllowEagerClassLoading(boolean allowEagerClassLoading) 
    Set whether the factory is allowed to eagerly load bean classes even for bean definitions that are marked as "lazy-init".

    Default is "true". Turn this flag off to suppress class loading for lazy-init beans unless such a bean is explicitly requested. In particular, by-type lookups will then simply ignore bean definitions without resolved class name, instead of loading the bean classes on demand just to perform a type check.

 public  void setAutowireCandidateResolver(AutowireCandidateResolver autowireCandidateResolver) 
    Set a custom autowire candidate resolver for this BeanFactory to use when deciding whether a bean definition should be considered as a candidate for autowiring.
 public String toString()