org.springframework.beans.factory.support
Class KualiDefaultListableBeanFactory

java.lang.Object
  extended by org.springframework.core.SimpleAliasRegistry
      extended by org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
          extended by org.springframework.beans.factory.support.FactoryBeanRegistrySupport
              extended by org.springframework.beans.factory.support.AbstractBeanFactory
                  extended by org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
                      extended by org.springframework.beans.factory.support.KualiDefaultListableBeanFactory
All Implemented Interfaces:
Serializable, org.springframework.beans.factory.BeanFactory, org.springframework.beans.factory.config.AutowireCapableBeanFactory, org.springframework.beans.factory.config.ConfigurableBeanFactory, org.springframework.beans.factory.config.ConfigurableListableBeanFactory, org.springframework.beans.factory.config.SingletonBeanRegistry, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.beans.factory.support.BeanDefinitionRegistry, org.springframework.core.AliasRegistry

public class KualiDefaultListableBeanFactory
extends org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
implements org.springframework.beans.factory.config.ConfigurableListableBeanFactory, org.springframework.beans.factory.support.BeanDefinitionRegistry, Serializable

Default implementation of the 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 XmlBeanDefinitionReader.

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

Implementation note: This class has been renamed from DefaultListableBeanFactory, but contains the fix contributed for performance problem related to large Spring configuration sets.

Since:
16 April 2001
Author:
Rod Johnson, Juergen Hoeller, Sam Brannen, Costin Leau
See Also:
StaticListableBeanFactory, PropertiesBeanDefinitionReader, XmlBeanDefinitionReader, Serialized Form

Field Summary
 
Fields inherited from class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
logger, NULL_OBJECT
 
Fields inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO
 
Fields inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
SCOPE_PROTOTYPE, SCOPE_SINGLETON
 
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
 
Constructor Summary
KualiDefaultListableBeanFactory()
          Create a new KualiDefaultListableBeanFactory.
KualiDefaultListableBeanFactory(org.springframework.beans.factory.BeanFactory parentBeanFactory)
          Create a new KualiDefaultListableBeanFactory with the given parent.
 
Method Summary
protected  void addBeanToParentMap(String parentName, String beanName)
           
protected  boolean allowAliasOverriding()
          Only allows alias overriding if bean definition overriding is allowed.
 boolean containsBeanDefinition(String beanName)
           
 void copyConfigurationFrom(org.springframework.beans.factory.config.ConfigurableBeanFactory otherFactory)
           
protected  String determinePrimaryCandidate(Map<String,Object> candidateBeans, org.springframework.beans.factory.config.DependencyDescriptor descriptor)
          Determine the primary autowire candidate in the given set of beans.
protected  Object doResolveDependency(org.springframework.beans.factory.config.DependencyDescriptor descriptor, Class<?> type, String beanName, Set<String> autowiredBeanNames, org.springframework.beans.TypeConverter typeConverter)
           
<A extends Annotation>
A
findAnnotationOnBean(String beanName, Class<A> annotationType)
          Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself, as well as checking its raw bean class if not found on the exposed bean reference (e.g.
protected  Map<String,Object> findAutowireCandidates(String beanName, Class requiredType, org.springframework.beans.factory.config.DependencyDescriptor descriptor)
          Find bean instances that match the required type.
 void freezeConfiguration()
           
 org.springframework.beans.factory.support.AutowireCandidateResolver getAutowireCandidateResolver()
          Return the autowire candidate resolver for this BeanFactory (never null).
<T> T
getBean(Class<T> requiredType)
           
 org.springframework.beans.factory.config.BeanDefinition getBeanDefinition(String beanName)
           
 int getBeanDefinitionCount()
           
 String[] getBeanDefinitionNames()
           
 String[] getBeanNamesForType(Class type)
           
 String[] getBeanNamesForType(Class type, boolean includeNonSingletons, boolean allowEagerInit)
           
<T> Map<String,T>
getBeansOfType(Class<T> type)
           
<T> Map<String,T>
getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
           
 Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
           
 boolean isAutowireCandidate(String beanName, org.springframework.beans.factory.config.DependencyDescriptor descriptor)
           
protected  boolean isAutowireCandidate(String beanName, org.springframework.beans.factory.support.RootBeanDefinition mbd, org.springframework.beans.factory.config.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 metadata caching if the factory's configuration has been marked as frozen.
 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.
protected  boolean matchesBeanName(String beanName, String candidateName)
          Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.
 void preInstantiateSingletons()
           
 void registerBeanDefinition(String beanName, org.springframework.beans.factory.config.BeanDefinition beanDefinition)
           
 void registerResolvableDependency(Class<?> dependencyType, Object autowiredValue)
           
 void removeBeanDefinition(String beanName)
           
protected  void resetBeanDefinition(String beanName)
          Reset all bean definition caches for the given bean, including the caches of beans that are derived from it.
 Object resolveDependency(org.springframework.beans.factory.config.DependencyDescriptor descriptor, String beanName, Set<String> autowiredBeanNames, org.springframework.beans.TypeConverter typeConverter)
           
 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.
 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".
 void setAutowireCandidateResolver(org.springframework.beans.factory.support.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.
 void setSerializationId(String serializationId)
          Specify an id for serialization purposes, allowing this BeanFactory to be deserialized from this id back into the BeanFactory object, if needed.
 String toString()
           
protected  Object writeReplace()
           
 
Methods inherited from class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPostProcessorsBeforeInstantiation, applyBeanPropertyValues, applyMergedBeanDefinitionPostProcessors, applyPropertyValues, autowire, autowireBean, autowireBeanProperties, autowireByName, autowireByType, autowireConstructor, checkDependencies, configureBean, createBean, createBean, createBean, createBeanInstance, determineConstructorsFromBeanPostProcessors, doCreateBean, filterPropertyDescriptorsForDependencyCheck, getEarlyBeanReference, getInstantiationStrategy, getParameterNameDiscoverer, getTypeForFactoryBean, getTypeForFactoryMethod, ignoreDependencyInterface, ignoreDependencyType, initializeBean, initializeBean, instantiateBean, instantiateUsingFactoryMethod, invokeCustomInitMethod, invokeInitMethods, isExcludedFromDependencyCheck, populateBean, postProcessObjectFromFactoryBean, predictBeanType, removeSingleton, resolveBeforeInstantiation, resolveDependency, setAllowCircularReferences, setAllowRawInjectionDespiteWrapping, setInstantiationStrategy, setParameterNameDiscoverer, unsatisfiedNonSimpleProperties
 
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanFactory
addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, afterPrototypeCreation, beforePrototypeCreation, checkMergedBeanDefinition, clearMergedBeanDefinition, containsBean, containsLocalBean, copyRegisteredEditorsTo, destroyBean, destroyBean, destroyScopedBean, doGetBean, evaluateBeanDefinitionString, getAccessControlContext, getAliases, getBean, getBean, getBean, getBean, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getBeanPostProcessors, getConversionService, getCustomEditors, getCustomTypeConverter, getMergedBeanDefinition, getMergedBeanDefinition, getMergedBeanDefinition, getMergedLocalBeanDefinition, getObjectForBeanInstance, getParentBeanFactory, getPropertyEditorRegistrars, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getType, getTypeConverter, hasDestructionAwareBeanPostProcessors, hasInstantiationAwareBeanPostProcessors, initBeanWrapper, isBeanNameInUse, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, isFactoryBean, isPrototype, isPrototypeCurrentlyInCreation, isSingleton, isTypeMatch, markBeanAsCreated, originalBeanName, registerCustomEditor, registerCustomEditors, registerDisposableBeanIfNecessary, registerScope, removeSingletonIfCreatedForTypeCheckOnly, requiresDestruction, resolveBeanClass, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, setSecurityContextProvider, setTempClassLoader, setTypeConverter, transformedBeanName
 
Methods inherited from class org.springframework.beans.factory.support.FactoryBeanRegistrySupport
getCachedObjectForFactoryBean, getFactoryBean, getObjectFromFactoryBean, getTypeForFactoryBean
 
Methods inherited from class 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, registerContainedBean, registerDependentBean, registerDisposableBean, registerSingleton, setCurrentlyInCreation
 
Methods inherited from class org.springframework.core.SimpleAliasRegistry
canonicalName, checkForAliasCircle, isAlias, registerAlias, removeAlias, resolveAliases
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
ignoreDependencyInterface, ignoreDependencyType
 
Methods inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPropertyValues, autowire, autowireBean, autowireBeanProperties, configureBean, createBean, createBean, initializeBean, resolveDependency
 
Methods inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, copyRegisteredEditorsTo, destroyBean, destroyScopedBean, destroySingletons, getAccessControlContext, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getConversionService, getDependenciesForBean, getDependentBeans, getMergedBeanDefinition, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getTypeConverter, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, registerAlias, registerCustomEditor, registerDependentBean, registerScope, resolveAliases, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setCurrentlyInCreation, setParentBeanFactory, setTempClassLoader, setTypeConverter
 
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
 
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
 
Methods inherited from interface org.springframework.beans.factory.config.SingletonBeanRegistry
containsSingleton, getSingleton, getSingletonCount, getSingletonNames, registerSingleton
 
Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry
isBeanNameInUse
 
Methods inherited from interface org.springframework.core.AliasRegistry
getAliases, isAlias, registerAlias, removeAlias
 

Constructor Detail

KualiDefaultListableBeanFactory

public KualiDefaultListableBeanFactory()
Create a new KualiDefaultListableBeanFactory.


KualiDefaultListableBeanFactory

public KualiDefaultListableBeanFactory(org.springframework.beans.factory.BeanFactory parentBeanFactory)
Create a new KualiDefaultListableBeanFactory with the given parent.

Parameters:
parentBeanFactory - the parent BeanFactory
Method Detail

setSerializationId

public void setSerializationId(String serializationId)
Specify an id for serialization purposes, allowing this BeanFactory to be deserialized from this id back into the BeanFactory object, if needed.


setAllowBeanDefinitionOverriding

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".

See Also:
registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)

setAllowEagerClassLoading

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.

See Also:
AbstractBeanDefinition.setLazyInit(boolean)

setAutowireCandidateResolver

public void setAutowireCandidateResolver(org.springframework.beans.factory.support.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.


getAutowireCandidateResolver

public org.springframework.beans.factory.support.AutowireCandidateResolver getAutowireCandidateResolver()
Return the autowire candidate resolver for this BeanFactory (never null).


copyConfigurationFrom

public void copyConfigurationFrom(org.springframework.beans.factory.config.ConfigurableBeanFactory otherFactory)
Specified by:
copyConfigurationFrom in interface org.springframework.beans.factory.config.ConfigurableBeanFactory
Overrides:
copyConfigurationFrom in class org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

getBean

public <T> T getBean(Class<T> requiredType)
          throws org.springframework.beans.BeansException
Specified by:
getBean in interface org.springframework.beans.factory.BeanFactory
Throws:
org.springframework.beans.BeansException

containsBeanDefinition

public boolean containsBeanDefinition(String beanName)
Specified by:
containsBeanDefinition in interface org.springframework.beans.factory.ListableBeanFactory
Specified by:
containsBeanDefinition in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
Specified by:
containsBeanDefinition in class org.springframework.beans.factory.support.AbstractBeanFactory

getBeanDefinitionCount

public int getBeanDefinitionCount()
Specified by:
getBeanDefinitionCount in interface org.springframework.beans.factory.ListableBeanFactory
Specified by:
getBeanDefinitionCount in interface org.springframework.beans.factory.support.BeanDefinitionRegistry

getBeanDefinitionNames

public String[] getBeanDefinitionNames()
Specified by:
getBeanDefinitionNames in interface org.springframework.beans.factory.ListableBeanFactory
Specified by:
getBeanDefinitionNames in interface org.springframework.beans.factory.support.BeanDefinitionRegistry

getBeanNamesForType

public String[] getBeanNamesForType(Class type)
Specified by:
getBeanNamesForType in interface org.springframework.beans.factory.ListableBeanFactory

getBeanNamesForType

public String[] getBeanNamesForType(Class type,
                                    boolean includeNonSingletons,
                                    boolean allowEagerInit)
Specified by:
getBeanNamesForType in interface org.springframework.beans.factory.ListableBeanFactory

getBeansOfType

public <T> Map<String,T> getBeansOfType(Class<T> type)
                             throws org.springframework.beans.BeansException
Specified by:
getBeansOfType in interface org.springframework.beans.factory.ListableBeanFactory
Throws:
org.springframework.beans.BeansException

getBeansOfType

public <T> Map<String,T> getBeansOfType(Class<T> type,
                                        boolean includeNonSingletons,
                                        boolean allowEagerInit)
                             throws org.springframework.beans.BeansException
Specified by:
getBeansOfType in interface org.springframework.beans.factory.ListableBeanFactory
Throws:
org.springframework.beans.BeansException

getBeansWithAnnotation

public Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
Specified by:
getBeansWithAnnotation in interface org.springframework.beans.factory.ListableBeanFactory

findAnnotationOnBean

public <A extends Annotation> A findAnnotationOnBean(String beanName,
                                                     Class<A> annotationType)
Find a Annotation of annotationType on the specified bean, traversing its interfaces and super classes if no annotation can be found on the given class itself, as well as checking its raw bean class if not found on the exposed bean reference (e.g. in case of a proxy).

Specified by:
findAnnotationOnBean in interface org.springframework.beans.factory.ListableBeanFactory

registerResolvableDependency

public void registerResolvableDependency(Class<?> dependencyType,
                                         Object autowiredValue)
Specified by:
registerResolvableDependency in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory

isAutowireCandidate

public boolean isAutowireCandidate(String beanName,
                                   org.springframework.beans.factory.config.DependencyDescriptor descriptor)
                            throws org.springframework.beans.factory.NoSuchBeanDefinitionException
Specified by:
isAutowireCandidate in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Throws:
org.springframework.beans.factory.NoSuchBeanDefinitionException

isAutowireCandidate

protected boolean isAutowireCandidate(String beanName,
                                      org.springframework.beans.factory.support.RootBeanDefinition mbd,
                                      org.springframework.beans.factory.config.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.

Parameters:
beanName - the name of the bean definition to check
mbd - the merged bean definition to check
descriptor - the descriptor of the dependency to resolve
Returns:
whether the bean should be considered as autowire candidate

getBeanDefinition

public org.springframework.beans.factory.config.BeanDefinition getBeanDefinition(String beanName)
                                                                          throws org.springframework.beans.factory.NoSuchBeanDefinitionException
Specified by:
getBeanDefinition in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Specified by:
getBeanDefinition in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
Specified by:
getBeanDefinition in class org.springframework.beans.factory.support.AbstractBeanFactory
Throws:
org.springframework.beans.factory.NoSuchBeanDefinitionException

freezeConfiguration

public void freezeConfiguration()
Specified by:
freezeConfiguration in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory

isConfigurationFrozen

public boolean isConfigurationFrozen()
Specified by:
isConfigurationFrozen in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory

isBeanEligibleForMetadataCaching

protected boolean isBeanEligibleForMetadataCaching(String beanName)
Considers all beans as eligible for metadata caching if the factory's configuration has been marked as frozen.

Overrides:
isBeanEligibleForMetadataCaching in class org.springframework.beans.factory.support.AbstractBeanFactory
See Also:
freezeConfiguration()

preInstantiateSingletons

public void preInstantiateSingletons()
                              throws org.springframework.beans.BeansException
Specified by:
preInstantiateSingletons in interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
Throws:
org.springframework.beans.BeansException

registerBeanDefinition

public void registerBeanDefinition(String beanName,
                                   org.springframework.beans.factory.config.BeanDefinition beanDefinition)
                            throws org.springframework.beans.factory.BeanDefinitionStoreException
Specified by:
registerBeanDefinition in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
Throws:
org.springframework.beans.factory.BeanDefinitionStoreException

removeBeanDefinition

public void removeBeanDefinition(String beanName)
                          throws org.springframework.beans.factory.NoSuchBeanDefinitionException
Specified by:
removeBeanDefinition in interface org.springframework.beans.factory.support.BeanDefinitionRegistry
Throws:
org.springframework.beans.factory.NoSuchBeanDefinitionException

resetBeanDefinition

protected void resetBeanDefinition(String beanName)
Reset all bean definition caches for the given bean, including the caches of beans that are derived from it.

Parameters:
beanName - the name of the bean to reset

addBeanToParentMap

protected void addBeanToParentMap(String parentName,
                                  String beanName)

allowAliasOverriding

protected boolean allowAliasOverriding()
Only allows alias overriding if bean definition overriding is allowed.

Overrides:
allowAliasOverriding in class org.springframework.core.SimpleAliasRegistry

resolveDependency

public Object resolveDependency(org.springframework.beans.factory.config.DependencyDescriptor descriptor,
                                String beanName,
                                Set<String> autowiredBeanNames,
                                org.springframework.beans.TypeConverter typeConverter)
                         throws org.springframework.beans.BeansException
Specified by:
resolveDependency in interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
Throws:
org.springframework.beans.BeansException

doResolveDependency

protected Object doResolveDependency(org.springframework.beans.factory.config.DependencyDescriptor descriptor,
                                     Class<?> type,
                                     String beanName,
                                     Set<String> autowiredBeanNames,
                                     org.springframework.beans.TypeConverter typeConverter)
                              throws org.springframework.beans.BeansException
Throws:
org.springframework.beans.BeansException

findAutowireCandidates

protected Map<String,Object> findAutowireCandidates(String beanName,
                                                    Class requiredType,
                                                    org.springframework.beans.factory.config.DependencyDescriptor descriptor)
Find bean instances that match the required type. Called during autowiring for the specified bean.

Parameters:
beanName - the name of the bean that is about to be wired
requiredType - the actual type of bean to look for (may be an array component type or collection element type)
descriptor - the descriptor of the dependency to resolve
Returns:
a Map of candidate names and candidate instances that match the required type (never null)
Throws:
org.springframework.beans.BeansException - in case of errors
See Also:
AbstractAutowireCapableBeanFactory.autowireByType(java.lang.String, org.springframework.beans.factory.support.AbstractBeanDefinition, org.springframework.beans.BeanWrapper, org.springframework.beans.MutablePropertyValues), AbstractAutowireCapableBeanFactory.autowireConstructor(java.lang.String, org.springframework.beans.factory.support.RootBeanDefinition, java.lang.reflect.Constructor[], java.lang.Object[])

determinePrimaryCandidate

protected String determinePrimaryCandidate(Map<String,Object> candidateBeans,
                                           org.springframework.beans.factory.config.DependencyDescriptor descriptor)
Determine the primary autowire candidate in the given set of beans.

Parameters:
candidateBeans - a Map of candidate names and candidate instances that match the required type, as returned by findAutowireCandidates(java.lang.String, java.lang.Class, org.springframework.beans.factory.config.DependencyDescriptor)
descriptor - the target dependency to match against
Returns:
the name of the primary candidate, or null if none found

isPrimary

protected boolean isPrimary(String beanName,
                            Object beanInstance)
Return whether the bean definition for the given bean name has been marked as a primary bean.

Parameters:
beanName - the name of the bean
beanInstance - the corresponding bean instance
Returns:
whether the given bean qualifies as primary

matchesBeanName

protected boolean matchesBeanName(String beanName,
                                  String candidateName)
Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.


toString

public String toString()
Overrides:
toString in class Object

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.