Package org.springframework.beans.factory.support

# Class DefaultListableBeanFactory

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:
  `Serializable`, `BeanFactory`, `AutowireCapableBeanFactory`, `ConfigurableBeanFactory`, `ConfigurableListableBeanFactory`, `SingletonBeanRegistry`, `HierarchicalBeanFactory`, `ListableBeanFactory`, `BeanDefinitionRegistry`, `org.springframework.core.AliasRegistry`

public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFactory implements ConfigurableListableBeanFactory, BeanDefinitionRegistry, Serializable
Spring's default implementation of the `ConfigurableListableBeanFactory` and `BeanDefinitionRegistry` interfaces: a full-fledged bean factory based on bean definition metadata, extensible through post-processors.

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

Note that readers for specific bean definition formats are typically implemented separately rather than as bean factory subclasses: see for example `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.

Since:
  16 April 2001
Author:
  Rod Johnson, Juergen Hoeller, Sam Brannen, Costin Leau, Chris Beams, Phillip Webb, Stephane Nicoll, Sebastien Deleuze
See Also:
  - `registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)`
  - `AbstractBeanFactory.addBeanPostProcessor(org.springframework.beans.factory.config.BeanPostProcessor)`
  - `getBean(java.lang.Class<T>)`
  - `resolveDependency(org.springframework.beans.factory.config.DependencyDescriptor, java.lang.String, java.util.Set<java.lang.String>, org.springframework.beans.TypeConverter)`
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`STRICT_LOCKING_PROPERTY_NAME`
System property that instructs Spring to enforce strict locking during bean creation, rather than the mix of strict and lenient locking that 6.2 applies by default.

### Fields inherited from class org.springframework.core.SimpleAliasRegistry

`logger`

### Fields inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory

`AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO, ORIGINAL_INSTANCE_SUFFIX`

### Fields inherited from interface org.springframework.beans.factory.BeanFactory

`FACTORY_BEAN_PREFIX, FACTORY_BEAN_PREFIX_CHAR`

### Fields inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory

`SCOPE_PROTOTYPE, SCOPE_SINGLETON`

## Constructor Summary

Constructors
Constructor
Description
`DefaultListableBeanFactory()`
Create a new DefaultListableBeanFactory.
`DefaultListableBeanFactory(BeanFactory parentBeanFactory)`
Create a new DefaultListableBeanFactory with the given parent.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addSingleton(String beanName, Object singletonObject)`
Add the given singleton object to the singleton registry.
`protected boolean`
`allowAliasOverriding()`
Only allows alias overriding if bean definition overriding is allowed.
`protected void`
`cacheMergedBeanDefinition(RootBeanDefinition mbd, String beanName)`
Cache the given merged bean definition.
`protected void`
`checkForAliasCircle(String name, String alias)`
Also checks for an alias overriding a bean definition of the same name.
`protected void`
`checkMergedBeanDefinition(RootBeanDefinition mbd, String beanName, Object[] args)`
Check the given merged bean definition, potentially throwing validation exceptions.
`protected void`
`clearMergedBeanDefinition(String beanName)`
Remove the merged bean definition for the specified bean, recreating it on next access.
`void`
`clearMetadataCache()`
Clear the merged bean definition cache, removing entries for beans which are not considered eligible for full metadata caching yet.
`boolean`
`containsBeanDefinition(String beanName)`
Check if this bean factory contains a bean definition with the given name.
`void`
`copyConfigurationFrom(ConfigurableBeanFactory otherFactory)`
Copy all relevant configuration from the given other factory.
`void`
`destroySingleton(String beanName)`
Destroy the given bean.
`void`
`destroySingletons()`
Destroy all singleton beans in this factory, including inner beans that have been registered as disposable.
`protected String`
`determineAutowireCandidate(Map<String,Object> candidates, DependencyDescriptor descriptor)`
Determine the autowire candidate in the given set of beans.
`protected String`
`determineHighestPriorityCandidate(Map<String,Object> candidates, Class<?> requiredType)`
Determine the candidate with the highest priority in the given set of beans.
`protected String`
`determinePrimaryCandidate(Map<String,Object> candidates, Class<?> requiredType)`
Determine the primary candidate in the given set of beans.
`Object`
`doResolveDependency(DependencyDescriptor descriptor, String beanName, Set<String> autowiredBeanNames, TypeConverter typeConverter)`
`<A extends Annotation>
Set<A>`
`findAllAnnotationsOnBean(String beanName, Class<A> annotationType, boolean allowFactoryBeanInit)`
Find all `Annotation` instances of `annotationType` on the specified bean, traversing its interfaces and superclasses if no annotation can be found on the given class itself, as well as checking the bean's factory method (if any).
`<A extends Annotation>
A`
`findAnnotationOnBean(String beanName, Class<A> annotationType)`
Find an `Annotation` of `annotationType` on the specified bean, traversing its interfaces and superclasses if no annotation can be found on the given class itself, as well as checking the bean's factory method (if any).
`<A extends Annotation>
A`
`findAnnotationOnBean(String beanName, Class<A> annotationType, boolean allowFactoryBeanInit)`
Find an `Annotation` of `annotationType` on the specified bean, traversing its interfaces and superclasses if no annotation can be found on the given class itself, as well as checking the bean's factory method (if any).
`protected Map<String,Object>`
`findAutowireCandidates(String beanName, Class<?> requiredType, DependencyDescriptor descriptor)`
Find bean instances that match the required type.
`void`
`freezeConfiguration()`
Freeze all bean definitions, signalling that the registered bean definitions will not be modified or post-processed any further.
`AutowireCandidateResolver`
`getAutowireCandidateResolver()`
Return the autowire candidate resolver for this BeanFactory (never `null`).
`<T> T`
`getBean(Class<T> requiredType)`
Return the bean instance that uniquely matches the given object type, if any.
`<T> T`
`getBean(Class<T> requiredType, Object... args)`
Return an instance, which may be shared or independent, of the specified bean.
`BeanDefinition`
`getBeanDefinition(String beanName)`
Return the bean definition for the given bean name.
`int`
`getBeanDefinitionCount()`
Return the number of beans defined in the factory.
`String[]`
`getBeanDefinitionNames()`
Return the names of all beans defined in this factory.
`String[]`
`getBeanNamesForAnnotation(Class<? extends Annotation> annotationType)`
Find all names of beans which are annotated with the supplied `Annotation` type, without creating corresponding bean instances yet.
`String[]`
`getBeanNamesForType(Class<?> type)`
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.
`String[]`
`getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean allowEagerInit)`
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.
`String[]`
`getBeanNamesForType(org.springframework.core.ResolvableType type)`
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.
`String[]`
`getBeanNamesForType(org.springframework.core.ResolvableType type, boolean includeNonSingletons, boolean allowEagerInit)`
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.
`Iterator<String>`
`getBeanNamesIterator()`
Return a unified view over all bean names managed by this factory.
`<T> ObjectProvider<T>`
`getBeanProvider(Class<T> requiredType)`
Return a provider for the specified bean, allowing for lazy on-demand retrieval of instances, including availability and uniqueness options.
`<T> ObjectProvider<T>`
`getBeanProvider(Class<T> requiredType, boolean allowEagerInit)`
Return a provider for the specified bean, allowing for lazy on-demand retrieval of instances, including availability and uniqueness options.
`<T> ObjectProvider<T>`
`getBeanProvider(org.springframework.core.ResolvableType requiredType)`
Return a provider for the specified bean, allowing for lazy on-demand retrieval of instances, including availability and uniqueness options.
`<T> ObjectProvider<T>`
`getBeanProvider(org.springframework.core.ResolvableType requiredType, boolean allowEagerInit)`
Return a provider for the specified bean, allowing for lazy on-demand retrieval of instances, including availability and uniqueness options.
`<T> Map<String,T>`
`getBeansOfType(Class<T> type)`
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.
`<T> Map<String,T>`
`getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)`
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.
`Map<String,Object>`
`getBeansWithAnnotation(Class<? extends Annotation> annotationType)`
Find all beans which are annotated with the supplied `Annotation` type, returning a Map of bean names with corresponding bean instances.
`Executor`
`getBootstrapExecutor()`
Return the `Executor` (possibly a `TaskExecutor`) for background bootstrapping, if any.
`Comparator<Object>`
`getDependencyComparator()`
Return the dependency comparator for this BeanFactory (may be `null`).
`protected Integer`
`getPriority(Object beanInstance)`
Return the priority assigned for the given bean instance by the `jakarta.annotation.Priority` annotation.
`String`
`getSerializationId()`
Return an id for serialization purposes, if specified, allowing this BeanFactory to be deserialized from this id back into the BeanFactory object, if needed.
`boolean`
`isAllowBeanDefinitionOverriding()`
Return whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.
`boolean`
`isAllowEagerClassLoading()`
Return whether the factory is allowed to eagerly load bean classes even for bean definitions that are marked as "lazy-init".
`boolean`
`isAutowireCandidate(String beanName, DependencyDescriptor descriptor)`
Determine whether the specified bean qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
`protected boolean`
`isAutowireCandidate(String beanName, DependencyDescriptor descriptor, AutowireCandidateResolver resolver)`
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`
`isAutowireCandidate(String beanName, RootBeanDefinition mbd, DependencyDescriptor descriptor, AutowireCandidateResolver resolver)`
Determine whether the specified bean definition qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.
`boolean`
`isBeanDefinitionOverridable(String beanName)`
This implementation returns `true` if bean definition overriding is generally allowed.
`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()`
Return whether this factory's bean definitions are frozen, i.e.
`protected Boolean`
`isCurrentThreadAllowedToHoldSingletonLock()`
Determine whether the current thread is allowed to hold the singleton lock.
`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 dependencyName)`
Determine whether the given dependency name matches the bean name or the aliases stored in this bean definition.
`protected Object`
`obtainInstanceFromSupplier(Supplier<?> supplier, String beanName, RootBeanDefinition mbd)`
Obtain a bean instance from the given supplier.
`void`
`preInstantiateSingletons()`
Ensure that all non-lazy-init singletons are instantiated, also considering `FactoryBeans`.
`void`
`prepareSingletonBootstrap()`
Mark current thread as main bootstrap thread for singleton instantiation, with lenient bootstrap locking applying for background threads.
`void`
`registerBeanDefinition(String beanName, BeanDefinition beanDefinition)`
Register a new bean definition with this registry.
`void`
`registerResolvableDependency(Class<?> dependencyType, Object autowiredValue)`
Register a special dependency type with corresponding autowired value.
`void`
`registerSingleton(String beanName, Object singletonObject)`
Register the given existing object as singleton in the bean registry, under the given bean name.
`void`
`removeBeanDefinition(String beanName)`
Remove the BeanDefinition for the given name.
`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(DependencyDescriptor descriptor, String requestingBeanName, Set<String> autowiredBeanNames, TypeConverter typeConverter)`
Resolve the specified dependency against the beans defined in this factory.
`<T> NamedBeanHolder<T>`
`resolveNamedBean(Class<T> requiredType)`
Resolve the bean instance that uniquely matches the given object type, if any, including its bean name.
`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(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`
`setBootstrapExecutor(Executor bootstrapExecutor)`
Set the `Executor` (possibly a `TaskExecutor`) for background bootstrapping.
`void`
`setDependencyComparator(Comparator<Object> dependencyComparator)`
Set a `Comparator` for dependency Lists and arrays.
`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, clearSingletonCache, configureBean, createBean, createBean, createBean, createBeanInstance, destroyBean, determineConstructorsFromBeanPostProcessors, determineTargetType, doCreateBean, filterPropertyDescriptorsForDependencyCheck, filterPropertyDescriptorsForDependencyCheck, getEarlyBeanReference, getInstantiationStrategy, getObjectForBeanInstance, getParameterNameDiscoverer, getTypeForFactoryBean, getTypeForFactoryMethod, ignoreDependencyInterface, ignoreDependencyType, initializeBean, initializeBean, instantiateBean, instantiateUsingFactoryMethod, invokeCustomInitMethod, invokeInitMethods, isAllowCircularReferences, isAllowRawInjectionDespiteWrapping, isExcludedFromDependencyCheck, populateBean, postProcessObjectFromFactoryBean, predictBeanType, removeSingleton, resolveBeanByName, resolveBeforeInstantiation, resolveDependency, setAllowCircularReferences, setAllowRawInjectionDespiteWrapping, setInstantiationStrategy, setParameterNameDiscoverer, unsatisfiedNonSimpleProperties`

### Methods inherited from class org.springframework.beans.factory.support.AbstractBeanFactory

`addBeanPostProcessor, addBeanPostProcessors, addEmbeddedValueResolver, addPropertyEditorRegistrar, afterPrototypeCreation, beforePrototypeCreation, cleanupAfterBeanCreationFailure, containsBean, containsLocalBean, copyRegisteredEditorsTo, destroyBean, destroyBean, destroyScopedBean, doGetBean, evaluateBeanDefinitionString, getAliases, getApplicationStartup, getBean, getBean, getBean, getBean, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getBeanPostProcessors, getConversionService, getCustomEditors, getCustomTypeConverter, getMergedBeanDefinition, getMergedBeanDefinition, getMergedBeanDefinition, getMergedLocalBeanDefinition, getParentBeanFactory, getPropertyEditorRegistrars, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getType, getType, getTypeConverter, hasBeanCreationStarted, hasDestructionAwareBeanPostProcessors, hasEmbeddedValueResolver, hasInstantiationAwareBeanPostProcessors, initBeanWrapper, isActuallyInCreation, isBeanNameInUse, isCacheBeanMetadata, isFactoryBean, isFactoryBean, isPrototype, isPrototypeCurrentlyInCreation, isSingleton, isTypeMatch, isTypeMatch, isTypeMatch, markBeanAsCreated, originalBeanName, registerCustomEditor, registerCustomEditors, registerDisposableBeanIfNecessary, registerScope, removeSingletonIfCreatedForTypeCheckOnly, requiresDestruction, resolveBeanClass, resolveEmbeddedValue, setApplicationStartup, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, 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

`addSingletonCallback, addSingletonFactory, afterSingletonCreation, beforeSingletonCreation, containsSingleton, destroyBean, getDependenciesForBean, getDependentBeans, getSingleton, getSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, hasDependentBean, isCurrentlyInCreation, isDependent, isSingletonCurrentlyInCreation, onSuppressedException, registerContainedBean, registerDependentBean, registerDisposableBean, setCurrentlyInCreation`

### Methods inherited from class org.springframework.core.SimpleAliasRegistry

`canonicalName, hasAlias, 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.core.AliasRegistry

`getAliases, isAlias, registerAlias, removeAlias`

### Methods inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory

`applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPropertyValues, autowire, autowireBean, autowireBeanProperties, configureBean, createBean, createBean, destroyBean, initializeBean, resolveBeanByName, resolveDependency`

### Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistry

`isBeanNameInUse`

### Methods inherited from interface org.springframework.beans.factory.BeanFactory

`containsBean, getAliases, getBean, getBean, getBean, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch`

### Methods inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory

`addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, copyRegisteredEditorsTo, destroyBean, destroyScopedBean, getApplicationStartup, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getConversionService, getDependenciesForBean, getDependentBeans, getMergedBeanDefinition, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getTypeConverter, hasEmbeddedValueResolver, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, registerAlias, registerCustomEditor, registerDependentBean, registerScope, resolveAliases, resolveEmbeddedValue, setApplicationStartup, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setCurrentlyInCreation, setParentBeanFactory, setTempClassLoader, setTypeConverter`

### Methods inherited from interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory

`ignoreDependencyInterface, ignoreDependencyType`

### Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory

`containsLocalBean, getParentBeanFactory`

### Methods inherited from interface org.springframework.beans.factory.config.SingletonBeanRegistry

`addSingletonCallback, containsSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames`

## Field Details

### STRICT_LOCKING_PROPERTY_NAME

public static final String STRICT_LOCKING_PROPERTY_NAME
System property that instructs Spring to enforce strict locking during bean creation, rather than the mix of strict and lenient locking that 6.2 applies by default. Setting this flag to "true" restores 6.1.x style locking in the entire pre-instantiation phase.

By default, the factory infers strict locking from the encountered thread names: If additional threads have names that match the thread prefix of the main bootstrap thread, they are considered external (multiple external bootstrap threads calling into the factory) and therefore have strict locking applied to them. This inference can be turned off through explicitly setting this flag to "false" rather than leaving it unspecified.

Since:
  6.2.6
See Also:
  - `preInstantiateSingletons()`
  - Constant Field Values

## Constructor Details

### DefaultListableBeanFactory

public DefaultListableBeanFactory()
Create a new DefaultListableBeanFactory.

### DefaultListableBeanFactory

public DefaultListableBeanFactory(@Nullable BeanFactory parentBeanFactory)
Create a new DefaultListableBeanFactory with the given parent.

Parameters:
  `parentBeanFactory` - the parent BeanFactory

## Method Details

### setSerializationId

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

### getSerializationId

@Nullable public String getSerializationId()
Return an id for serialization purposes, if specified, allowing this BeanFactory to be deserialized from this id back into the BeanFactory object, if needed.

Since:
  4.1.2

### 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)`

### isAllowBeanDefinitionOverriding

public boolean isAllowBeanDefinitionOverriding()
Return whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.

Since:
  4.1.2

### 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)`

### isAllowEagerClassLoading

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

Since:
  4.1.2

### setBootstrapExecutor

public void setBootstrapExecutor(@Nullable Executor bootstrapExecutor)
Description copied from interface: `ConfigurableBeanFactory`
Set the `Executor` (possibly a `TaskExecutor`) for background bootstrapping.

Specified by:
  `setBootstrapExecutor` in interface `ConfigurableBeanFactory`
See Also:
  - `AbstractBeanDefinition.setBackgroundInit(boolean)`

### getBootstrapExecutor

@Nullable public Executor getBootstrapExecutor()
Description copied from interface: `ConfigurableBeanFactory`
Return the `Executor` (possibly a `TaskExecutor`) for background bootstrapping, if any.

Specified by:
  `getBootstrapExecutor` in interface `ConfigurableBeanFactory`

### setDependencyComparator

public void setDependencyComparator(@Nullable Comparator<Object> dependencyComparator)
Set a `Comparator` for dependency Lists and arrays.

Since:
  4.0
See Also:
  - `OrderComparator`
  - `AnnotationAwareOrderComparator`

### getDependencyComparator

@Nullable public Comparator<Object> getDependencyComparator()
Return the dependency comparator for this BeanFactory (may be `null`).

Since:
  4.0

### setAutowireCandidateResolver

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.

### getAutowireCandidateResolver

public AutowireCandidateResolver getAutowireCandidateResolver()
Return the autowire candidate resolver for this BeanFactory (never `null`).

### copyConfigurationFrom

public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)
Description copied from interface: `ConfigurableBeanFactory`
Copy all relevant configuration from the given other factory.

Should include all standard configuration settings as well as BeanPostProcessors, Scopes, and factory-specific internal settings. Should not include any metadata of actual bean definitions, such as BeanDefinition objects and bean name aliases.

Specified by:
  `copyConfigurationFrom` in interface `ConfigurableBeanFactory`
Overrides:
  `copyConfigurationFrom` in class `AbstractAutowireCapableBeanFactory`
Parameters:
  `otherFactory` - the other BeanFactory to copy from

### getBean

public <T> T getBean(Class<T> requiredType) throws BeansException
Description copied from interface: `BeanFactory`
Return the bean instance that uniquely matches the given object type, if any.

This method goes into `ListableBeanFactory` by-type lookup territory but may also be translated into a conventional by-name lookup based on the name of the given type. For more extensive retrieval operations across sets of beans, use `ListableBeanFactory` and/or `BeanFactoryUtils`.

Specified by:
  `getBean` in interface `BeanFactory`
Parameters:
  `requiredType` - type the bean must match; can be an interface or superclass
Returns:
  an instance of the single bean matching the required type
Throws:
  `NoSuchBeanDefinitionException` - if no bean of the given type was found
  `NoUniqueBeanDefinitionException` - if more than one bean of the given type was found
  `BeansException` - if the bean could not be created
See Also:
  - `ListableBeanFactory`

### getBean

public <T> T getBean(Class<T> requiredType, @Nullable Object... args) throws BeansException
Description copied from interface: `BeanFactory`
Return an instance, which may be shared or independent, of the specified bean.

Allows for specifying explicit constructor arguments / factory method arguments, overriding the specified default arguments (if any) in the bean definition. Note that the provided arguments need to match a specific candidate constructor / factory method in the order of declared parameters.

This method goes into `ListableBeanFactory` by-type lookup territory but may also be translated into a conventional by-name lookup based on the name of the given type. For more extensive retrieval operations across sets of beans, use `ListableBeanFactory` and/or `BeanFactoryUtils`.

Specified by:
  `getBean` in interface `BeanFactory`
Parameters:
  `requiredType` - type the bean must match; can be an interface or superclass
  `args` - arguments to use when creating a bean instance using explicit arguments (only applied when creating a new instance as opposed to retrieving an existing one)
Returns:
  an instance of the bean
Throws:
  `NoSuchBeanDefinitionException` - if there is no such bean definition
  `BeanDefinitionStoreException` - if arguments have been given but the affected bean isn't a prototype
  `BeansException` - if the bean could not be created

### getBeanProvider

public <T> ObjectProvider<T> getBeanProvider(Class<T> requiredType)
Description copied from interface: `BeanFactory`
Return a provider for the specified bean, allowing for lazy on-demand retrieval of instances, including availability and uniqueness options.

For matching a generic type, consider `BeanFactory.getBeanProvider(ResolvableType)`.

Specified by:
  `getBeanProvider` in interface `BeanFactory`
Parameters:
  `requiredType` - type the bean must match; can be an interface or superclass
Returns:
  a corresponding provider handle
See Also:
  - `BeanFactory.getBeanProvider(ResolvableType)`

### getBeanProvider

public <T> ObjectProvider<T> getBeanProvider(org.springframework.core.ResolvableType requiredType)
Description copied from interface: `BeanFactory`
Return a provider for the specified bean, allowing for lazy on-demand retrieval of instances, including availability and uniqueness options. This variant allows for specifying a generic type to match, similar to reflective injection points with generic type declarations in method/constructor parameters.

Note that collections of beans are not supported here, in contrast to reflective injection points. For programmatically retrieving a list of beans matching a specific type, specify the actual bean type as an argument here and subsequently use `ObjectProvider.orderedStream()` or its lazy streaming/iteration options.

Also, generics matching is strict here, as per the Java assignment rules. For lenient fallback matching with unchecked semantics (similar to the 'unchecked' Java compiler warning), consider calling `BeanFactory.getBeanProvider(Class)` with the raw type as a second step if no full generic match is `available` with this variant.

Specified by:
  `getBeanProvider` in interface `BeanFactory`
Parameters:
  `requiredType` - type the bean must match; can be a generic type declaration
Returns:
  a corresponding provider handle
See Also:
  - `ObjectProvider.iterator()`
  - `ObjectProvider.stream()`
  - `ObjectProvider.orderedStream()`

### containsBeanDefinition

public boolean containsBeanDefinition(String beanName)
Description copied from class: `AbstractBeanFactory`
Check if this bean factory contains a bean definition with the given name. Does not consider any hierarchy this factory may participate in. Invoked by `containsBean` when no cached singleton instance is found.

Depending on the nature of the concrete bean factory implementation, this operation might be expensive (for example, because of directory lookups in external registries). However, for listable bean factories, this usually just amounts to a local hash lookup: The operation is therefore part of the public interface there. The same implementation can serve for both this template method and the public interface method in that case.

Specified by:
  `containsBeanDefinition` in interface `BeanDefinitionRegistry`
Specified by:
  `containsBeanDefinition` in interface `ListableBeanFactory`
Specified by:
  `containsBeanDefinition` in class `AbstractBeanFactory`
Parameters:
  `beanName` - the name of the bean to look for
Returns:
  if this bean factory contains a bean definition with the given name
See Also:
  - `AbstractBeanFactory.containsBean(java.lang.String)`
  - `ListableBeanFactory.containsBeanDefinition(java.lang.String)`

### getBeanDefinitionCount

public int getBeanDefinitionCount()
Description copied from interface: `ListableBeanFactory`
Return the number of beans defined in the factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Specified by:
  `getBeanDefinitionCount` in interface `BeanDefinitionRegistry`
Specified by:
  `getBeanDefinitionCount` in interface `ListableBeanFactory`
Returns:
  the number of beans defined in the factory

### getBeanDefinitionNames

public String[] getBeanDefinitionNames()
Description copied from interface: `ListableBeanFactory`
Return the names of all beans defined in this factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.

Specified by:
  `getBeanDefinitionNames` in interface `BeanDefinitionRegistry`
Specified by:
  `getBeanDefinitionNames` in interface `ListableBeanFactory`
Returns:
  the names of all beans defined in this factory, or an empty array if none defined

### getBeanProvider

public <T> ObjectProvider<T> getBeanProvider(Class<T> requiredType, boolean allowEagerInit)
Description copied from interface: `ListableBeanFactory`
Return a provider for the specified bean, allowing for lazy on-demand retrieval of instances, including availability and uniqueness options.

Specified by:
  `getBeanProvider` in interface `ListableBeanFactory`
Parameters:
  `requiredType` - type the bean must match; can be an interface or superclass
  `allowEagerInit` - whether stream access may introspect lazy-init singletons and objects created by FactoryBeans - or by factory methods with a "factory-bean" reference - for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references. Only actually necessary initialization for type checking purposes will be performed; constructor and method invocations will still be avoided as far as possible.
Returns:
  a corresponding provider handle
See Also:
  - `ListableBeanFactory.getBeanProvider(ResolvableType, boolean)`
  - `BeanFactory.getBeanProvider(Class)`
  - `ListableBeanFactory.getBeansOfType(Class, boolean, boolean)`
  - `ListableBeanFactory.getBeanNamesForType(Class, boolean, boolean)`

### getBeanProvider

public <T> ObjectProvider<T> getBeanProvider(org.springframework.core.ResolvableType requiredType, boolean allowEagerInit)
Description copied from interface: `ListableBeanFactory`
Return a provider for the specified bean, allowing for lazy on-demand retrieval of instances, including availability and uniqueness options.

Specified by:
  `getBeanProvider` in interface `ListableBeanFactory`
Parameters:
  `requiredType` - type the bean must match; can be a generic type declaration. Note that collection types are not supported here, in contrast to reflective injection points. For programmatically retrieving a list of beans matching a specific type, specify the actual bean type as an argument here and subsequently use `ObjectProvider.orderedStream()` or its lazy streaming/iteration options.
  `allowEagerInit` - whether stream access may introspect lazy-init singletons and objects created by FactoryBeans - or by factory methods with a "factory-bean" reference - for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references. Only actually necessary initialization for type checking purposes will be performed; constructor and method invocations will still be avoided as far as possible.
Returns:
  a corresponding provider handle
See Also:
  - `BeanFactory.getBeanProvider(ResolvableType)`
  - `ObjectProvider.iterator()`
  - `ObjectProvider.stream()`
  - `ObjectProvider.orderedStream()`
  - `ListableBeanFactory.getBeanNamesForType(ResolvableType, boolean, boolean)`

### getBeanNamesForType

public String[] getBeanNamesForType(org.springframework.core.ResolvableType type)
Description copied from interface: `ListableBeanFactory`
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' `beanNamesForTypeIncludingAncestors` to include beans in ancestor factories too.

This version of `getBeanNamesForType` matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for `getBeanNamesForType(type, true, true)`.

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Specified by:
  `getBeanNamesForType` in interface `ListableBeanFactory`
Parameters:
  `type` - the generically typed class or interface to match
Returns:
  the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
  - `BeanFactory.isTypeMatch(String, ResolvableType)`
  - `FactoryBean.getObjectType()`
  - `BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, ResolvableType)`

### getBeanNamesForType

public String[] getBeanNamesForType(org.springframework.core.ResolvableType type, boolean includeNonSingletons, boolean allowEagerInit)
Description copied from interface: `ListableBeanFactory`
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' `beanNamesForTypeIncludingAncestors` to include beans in ancestor factories too.

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Specified by:
  `getBeanNamesForType` in interface `ListableBeanFactory`
Parameters:
  `type` - the generically typed class or interface to match
  `includeNonSingletons` - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
  `allowEagerInit` - whether to introspect lazy-init singletons and objects created by FactoryBeans - or by factory methods with a "factory-bean" reference - for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references. Only actually necessary initialization for type checking purposes will be performed; constructor and method invocations will still be avoided as far as possible.
Returns:
  the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
  - `FactoryBean.getObjectType()`
  - `BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, ResolvableType, boolean, boolean)`

### getBeanNamesForType

public String[] getBeanNamesForType(@Nullable Class<?> type)
Description copied from interface: `ListableBeanFactory`
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' `beanNamesForTypeIncludingAncestors` to include beans in ancestor factories too.

This version of `getBeanNamesForType` matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for `getBeanNamesForType(type, true, true)`.

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Specified by:
  `getBeanNamesForType` in interface `ListableBeanFactory`
Parameters:
  `type` - the class or interface to match, or `null` for all bean names
Returns:
  the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
  - `FactoryBean.getObjectType()`
  - `BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class)`

### getBeanNamesForType

public String[] getBeanNamesForType(@Nullable Class<?> type, boolean includeNonSingletons, boolean allowEagerInit)
Description copied from interface: `ListableBeanFactory`
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' `beanNamesForTypeIncludingAncestors` to include beans in ancestor factories too.

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.

Specified by:
  `getBeanNamesForType` in interface `ListableBeanFactory`
Parameters:
  `type` - the class or interface to match, or `null` for all bean names
  `includeNonSingletons` - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
  `allowEagerInit` - whether to introspect lazy-init singletons and objects created by FactoryBeans - or by factory methods with a "factory-bean" reference - for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references. Only actually necessary initialization for type checking purposes will be performed; constructor and method invocations will still be avoided as far as possible.
Returns:
  the names of beans (or objects created by FactoryBeans) matching the given object type (including subclasses), or an empty array if none
See Also:
  - `FactoryBean.getObjectType()`
  - `BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)`

### getBeansOfType

public <T> Map<String,T> getBeansOfType(@Nullable Class<T> type) throws BeansException
Description copied from interface: `ListableBeanFactory`
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well. Also, it suppresses exceptions for beans that are currently in creation in a circular reference scenario: typically, references back to the caller of this method.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' `beansOfTypeIncludingAncestors` to include beans in ancestor factories too.

This version of getBeansOfType matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for `getBeansOfType(type, true, true)`.

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible.

Consider `ListableBeanFactory.getBeanNamesForType(Class)` with selective `BeanFactory.getBean(java.lang.String)` calls for specific bean names in preference to this Map-based retrieval method. Aside from lazy instantiation benefits, this also avoids any exception suppression.

Specified by:
  `getBeansOfType` in interface `ListableBeanFactory`
Parameters:
  `type` - the class or interface to match, or `null` for all concrete beans
Returns:
  a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
  `BeansException` - if a bean could not be created
See Also:
  - `FactoryBean.getObjectType()`
  - `BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactory, Class)`

### getBeansOfType

public <T> Map<String,T> getBeansOfType(@Nullable Class<T> type, boolean includeNonSingletons, boolean allowEagerInit) throws BeansException
Description copied from interface: `ListableBeanFactory`
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of `getObjectType` in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well. Also, it suppresses exceptions for beans that are currently in creation in a circular reference scenario: typically, references back to the caller of this method.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' `beansOfTypeIncludingAncestors` to include beans in ancestor factories too.

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible.

Consider `ListableBeanFactory.getBeanNamesForType(Class)` with selective `BeanFactory.getBean(java.lang.String)` calls for specific bean names in preference to this Map-based retrieval method. Aside from lazy instantiation benefits, this also avoids any exception suppression.

Specified by:
  `getBeansOfType` in interface `ListableBeanFactory`
Parameters:
  `type` - the class or interface to match, or `null` for all concrete beans
  `includeNonSingletons` - whether to include prototype or scoped beans too or just singletons (also applies to FactoryBeans)
  `allowEagerInit` - whether to introspect lazy-init singletons and objects created by FactoryBeans - or by factory methods with a "factory-bean" reference - for the type check. Note that FactoryBeans need to be eagerly initialized to determine their type: So be aware that passing in "true" for this flag will initialize FactoryBeans and "factory-bean" references. Only actually necessary initialization for type checking purposes will be performed; constructor and method invocations will still be avoided as far as possible.
Returns:
  a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
Throws:
  `BeansException` - if a bean could not be created
See Also:
  - `FactoryBean.getObjectType()`
  - `BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)`

### getBeanNamesForAnnotation

public String[] getBeanNamesForAnnotation(Class<? extends Annotation> annotationType)
Description copied from interface: `ListableBeanFactory`
Find all names of beans which are annotated with the supplied `Annotation` type, without creating corresponding bean instances yet.

Note that this method considers objects created by FactoryBeans, which means that FactoryBeans will get initialized in order to determine their object type.

Specified by:
  `getBeanNamesForAnnotation` in interface `ListableBeanFactory`
Parameters:
  `annotationType` - the type of annotation to look for (at class, interface or factory method level of the specified bean)
Returns:
  the names of all matching beans
See Also:
  - `ListableBeanFactory.getBeansWithAnnotation(Class)`
  - `ListableBeanFactory.findAnnotationOnBean(String, Class)`

### getBeansWithAnnotation

public Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
Description copied from interface: `ListableBeanFactory`
Find all beans which are annotated with the supplied `Annotation` type, returning a Map of bean names with corresponding bean instances.

Note that this method considers objects created by FactoryBeans, which means that FactoryBeans will get initialized in order to determine their object type.

Specified by:
  `getBeansWithAnnotation` in interface `ListableBeanFactory`
Parameters:
  `annotationType` - the type of annotation to look for (at class, interface or factory method level of the specified bean)
Returns:
  a Map with the matching beans, containing the bean names as keys and the corresponding bean instances as values
See Also:
  - `ListableBeanFactory.findAnnotationOnBean(String, Class)`
  - `ListableBeanFactory.findAnnotationOnBean(String, Class, boolean)`
  - `ListableBeanFactory.findAllAnnotationsOnBean(String, Class, boolean)`

### findAnnotationOnBean

@Nullable public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) throws NoSuchBeanDefinitionException
Description copied from interface: `ListableBeanFactory`
Find an `Annotation` of `annotationType` on the specified bean, traversing its interfaces and superclasses if no annotation can be found on the given class itself, as well as checking the bean's factory method (if any).

Specified by:
  `findAnnotationOnBean` in interface `ListableBeanFactory`
Parameters:
  `beanName` - the name of the bean to look for annotations on
  `annotationType` - the type of annotation to look for (at class, interface or factory method level of the specified bean)
Returns:
  the annotation of the given type if found, or `null` otherwise
Throws:
  `NoSuchBeanDefinitionException` - if there is no bean with the given name
See Also:
  - `ListableBeanFactory.findAnnotationOnBean(String, Class, boolean)`
  - `ListableBeanFactory.findAllAnnotationsOnBean(String, Class, boolean)`
  - `ListableBeanFactory.getBeanNamesForAnnotation(Class)`
  - `ListableBeanFactory.getBeansWithAnnotation(Class)`
  - `BeanFactory.getType(String)`

### findAnnotationOnBean

@Nullable public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType, boolean allowFactoryBeanInit) throws NoSuchBeanDefinitionException
Description copied from interface: `ListableBeanFactory`
Find an `Annotation` of `annotationType` on the specified bean, traversing its interfaces and superclasses if no annotation can be found on the given class itself, as well as checking the bean's factory method (if any).

Specified by:
  `findAnnotationOnBean` in interface `ListableBeanFactory`
Parameters:
  `beanName` - the name of the bean to look for annotations on
  `annotationType` - the type of annotation to look for (at class, interface or factory method level of the specified bean)
  `allowFactoryBeanInit` - whether a `FactoryBean` may get initialized just for the purpose of determining its object type
Returns:
  the annotation of the given type if found, or `null` otherwise
Throws:
  `NoSuchBeanDefinitionException` - if there is no bean with the given name
See Also:
  - `ListableBeanFactory.findAnnotationOnBean(String, Class)`
  - `ListableBeanFactory.findAllAnnotationsOnBean(String, Class, boolean)`
  - `ListableBeanFactory.getBeanNamesForAnnotation(Class)`
  - `ListableBeanFactory.getBeansWithAnnotation(Class)`
  - `BeanFactory.getType(String, boolean)`

### findAllAnnotationsOnBean

public <A extends Annotation> Set<A> findAllAnnotationsOnBean(String beanName, Class<A> annotationType, boolean allowFactoryBeanInit) throws NoSuchBeanDefinitionException
Description copied from interface: `ListableBeanFactory`
Find all `Annotation` instances of `annotationType` on the specified bean, traversing its interfaces and superclasses if no annotation can be found on the given class itself, as well as checking the bean's factory method (if any).

Specified by:
  `findAllAnnotationsOnBean` in interface `ListableBeanFactory`
Parameters:
  `beanName` - the name of the bean to look for annotations on
  `annotationType` - the type of annotation to look for (at class, interface or factory method level of the specified bean)
  `allowFactoryBeanInit` - whether a `FactoryBean` may get initialized just for the purpose of determining its object type
Returns:
  the set of annotations of the given type found (potentially empty)
Throws:
  `NoSuchBeanDefinitionException` - if there is no bean with the given name
See Also:
  - `ListableBeanFactory.getBeanNamesForAnnotation(Class)`
  - `ListableBeanFactory.findAnnotationOnBean(String, Class, boolean)`
  - `BeanFactory.getType(String, boolean)`

### registerResolvableDependency

public void registerResolvableDependency(Class<?> dependencyType, @Nullable Object autowiredValue)
Description copied from interface: `ConfigurableListableBeanFactory`
Register a special dependency type with corresponding autowired value.

This is intended for factory/context references that are supposed to be autowirable but are not defined as beans in the factory: for example, a dependency of type ApplicationContext resolved to the ApplicationContext instance that the bean is living in.

Note: There are no such default types registered in a plain BeanFactory, not even for the BeanFactory interface itself.

Specified by:
  `registerResolvableDependency` in interface `ConfigurableListableBeanFactory`
Parameters:
  `dependencyType` - the dependency type to register. This will typically be a base interface such as BeanFactory, with extensions of it resolved as well if declared as an autowiring dependency (for example, ListableBeanFactory), as long as the given value actually implements the extended interface.
  `autowiredValue` - the corresponding autowired value. This may also be an implementation of the `ObjectFactory` interface, which allows for lazy resolution of the actual target value.

### isAutowireCandidate

public boolean isAutowireCandidate(String beanName, DependencyDescriptor descriptor) throws NoSuchBeanDefinitionException
Description copied from interface: `ConfigurableListableBeanFactory`
Determine whether the specified bean qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.

This method checks ancestor factories as well.

Specified by:
  `isAutowireCandidate` in interface `ConfigurableListableBeanFactory`
Parameters:
  `beanName` - the name of the bean to check
  `descriptor` - the descriptor of the dependency to resolve
Returns:
  whether the bean should be considered as autowire candidate
Throws:
  `NoSuchBeanDefinitionException` - if there is no bean with the given name

### isAutowireCandidate

protected boolean isAutowireCandidate(String beanName, DependencyDescriptor descriptor, AutowireCandidateResolver resolver) throws NoSuchBeanDefinitionException
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
  `descriptor` - the descriptor of the dependency to resolve
  `resolver` - the AutowireCandidateResolver to use for the actual resolution algorithm
Returns:
  whether the bean should be considered as autowire candidate
Throws:
  `NoSuchBeanDefinitionException`

### isAutowireCandidate

protected boolean isAutowireCandidate(String beanName, RootBeanDefinition mbd, DependencyDescriptor descriptor, AutowireCandidateResolver resolver)
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
  `resolver` - the AutowireCandidateResolver to use for the actual resolution algorithm
Returns:
  whether the bean should be considered as autowire candidate

### getBeanDefinition

public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException
Description copied from class: `AbstractBeanFactory`
Return the bean definition for the given bean name. Subclasses should normally implement caching, as this method is invoked by this class every time bean definition metadata is needed.

Depending on the nature of the concrete bean factory implementation, this operation might be expensive (for example, because of directory lookups in external registries). However, for listable bean factories, this usually just amounts to a local hash lookup: The operation is therefore part of the public interface there. The same implementation can serve for both this template method and the public interface method in that case.

Specified by:
  `getBeanDefinition` in interface `BeanDefinitionRegistry`
Specified by:
  `getBeanDefinition` in interface `ConfigurableListableBeanFactory`
Specified by:
  `getBeanDefinition` in class `AbstractBeanFactory`
Parameters:
  `beanName` - the name of the bean to find a definition for
Returns:
  the BeanDefinition for this prototype name (never `null`)
Throws:
  `NoSuchBeanDefinitionException` - if the bean definition cannot be resolved
See Also:
  - `RootBeanDefinition`
  - `ChildBeanDefinition`
  - `ConfigurableListableBeanFactory.getBeanDefinition(java.lang.String)`

### getBeanNamesIterator

public Iterator<String> getBeanNamesIterator()
Description copied from interface: `ConfigurableListableBeanFactory`
Return a unified view over all bean names managed by this factory.

Includes bean definition names as well as names of manually registered singleton instances, with bean definition names consistently coming first, analogous to how type/annotation specific retrieval of bean names works.

Specified by:
  `getBeanNamesIterator` in interface `ConfigurableListableBeanFactory`
Returns:
  the composite iterator for the bean names view
See Also:
  - `ListableBeanFactory.containsBeanDefinition(java.lang.String)`
  - `SingletonBeanRegistry.registerSingleton(java.lang.String, java.lang.Object)`
  - `ListableBeanFactory.getBeanNamesForType(org.springframework.core.ResolvableType)`
  - `ListableBeanFactory.getBeanNamesForAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation>)`

### clearMergedBeanDefinition

protected void clearMergedBeanDefinition(String beanName)
Description copied from class: `AbstractBeanFactory`
Remove the merged bean definition for the specified bean, recreating it on next access.

Overrides:
  `clearMergedBeanDefinition` in class `AbstractBeanFactory`
Parameters:
  `beanName` - the bean name to clear the merged definition for

### clearMetadataCache

public void clearMetadataCache()
Description copied from class: `AbstractBeanFactory`
Clear the merged bean definition cache, removing entries for beans which are not considered eligible for full metadata caching yet.

Typically triggered after changes to the original bean definitions, for example, after applying a `BeanFactoryPostProcessor`. Note that metadata for beans which have already been created at this point will be kept around.

Specified by:
  `clearMetadataCache` in interface `ConfigurableListableBeanFactory`
Overrides:
  `clearMetadataCache` in class `AbstractBeanFactory`
See Also:
  - `ConfigurableListableBeanFactory.getBeanDefinition(java.lang.String)`
  - `ConfigurableBeanFactory.getMergedBeanDefinition(java.lang.String)`

### freezeConfiguration

public void freezeConfiguration()
Description copied from interface: `ConfigurableListableBeanFactory`
Freeze all bean definitions, signalling that the registered bean definitions will not be modified or post-processed any further.

This allows the factory to aggressively cache bean definition metadata going forward, after clearing the initial temporary metadata cache.

Specified by:
  `freezeConfiguration` in interface `ConfigurableListableBeanFactory`
See Also:
  - `ConfigurableListableBeanFactory.clearMetadataCache()`
  - `ConfigurableListableBeanFactory.isConfigurationFrozen()`

### isConfigurationFrozen

public boolean isConfigurationFrozen()
Description copied from interface: `ConfigurableListableBeanFactory`
Return whether this factory's bean definitions are frozen, i.e. are not supposed to be modified or post-processed any further.

Specified by:
  `isConfigurationFrozen` in interface `ConfigurableListableBeanFactory`
Returns:
  `true` if the factory's configuration is considered frozen
See Also:
  - `ConfigurableListableBeanFactory.freezeConfiguration()`

### 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 `AbstractBeanFactory`
Parameters:
  `beanName` - the name of the bean
Returns:
  `true` if the bean's metadata may be cached at this point already
See Also:
  - `freezeConfiguration()`

### obtainInstanceFromSupplier

@Nullable protected Object obtainInstanceFromSupplier(Supplier<?> supplier, String beanName, RootBeanDefinition mbd) throws Exception
Description copied from class: `AbstractAutowireCapableBeanFactory`
Obtain a bean instance from the given supplier.

Overrides:
  `obtainInstanceFromSupplier` in class `AbstractAutowireCapableBeanFactory`
Parameters:
  `supplier` - the configured supplier
  `beanName` - the corresponding bean name
  `mbd` - the bean definition for the bean
Returns:
  the bean instance (possibly `null`)
Throws:
  `Exception`

### cacheMergedBeanDefinition

protected void cacheMergedBeanDefinition(RootBeanDefinition mbd, String beanName)
Description copied from class: `AbstractBeanFactory`
Cache the given merged bean definition.

Subclasses can override this to derive additional cached state from the final post-processed bean definition.

Overrides:
  `cacheMergedBeanDefinition` in class `AbstractBeanFactory`
Parameters:
  `mbd` - the merged bean definition to cache
  `beanName` - the name of the bean

### checkMergedBeanDefinition

protected void checkMergedBeanDefinition(RootBeanDefinition mbd, String beanName, @Nullable Object[] args)
Description copied from class: `AbstractBeanFactory`
Check the given merged bean definition, potentially throwing validation exceptions.

Overrides:
  `checkMergedBeanDefinition` in class `AbstractBeanFactory`
Parameters:
  `mbd` - the merged bean definition to check
  `beanName` - the name of the bean
  `args` - the arguments for bean creation, if any

### isCurrentThreadAllowedToHoldSingletonLock

@Nullable protected Boolean isCurrentThreadAllowedToHoldSingletonLock()
Description copied from class: `DefaultSingletonBeanRegistry`
Determine whether the current thread is allowed to hold the singleton lock.

By default, all threads are forced to hold a full lock through `null`. `DefaultListableBeanFactory` overrides this to specifically handle its threads during the pre-instantiation phase: `true` for the main thread, `false` for managed background threads, and configuration-dependent behavior for unmanaged threads.

Overrides:
  `isCurrentThreadAllowedToHoldSingletonLock` in class `DefaultSingletonBeanRegistry`
Returns:
  `true` if the current thread is explicitly allowed to hold the lock but also accepts lenient fallback behavior, `false` if it is explicitly not allowed to hold the lock and therefore forced to use lenient fallback behavior, or `null` if there is no specific indication (traditional behavior: forced to always hold a full lock)

### prepareSingletonBootstrap

public void prepareSingletonBootstrap()
Description copied from interface: `ConfigurableListableBeanFactory`
Mark current thread as main bootstrap thread for singleton instantiation, with lenient bootstrap locking applying for background threads.

Any such marker is to be removed at the end of the managed bootstrap in `ConfigurableListableBeanFactory.preInstantiateSingletons()`.

Specified by:
  `prepareSingletonBootstrap` in interface `ConfigurableListableBeanFactory`
See Also:
  - `ConfigurableBeanFactory.setBootstrapExecutor(java.util.concurrent.Executor)`
  - `ConfigurableListableBeanFactory.preInstantiateSingletons()`

### preInstantiateSingletons

public void preInstantiateSingletons() throws BeansException
Description copied from interface: `ConfigurableListableBeanFactory`
Ensure that all non-lazy-init singletons are instantiated, also considering `FactoryBeans`. Typically invoked at the end of factory setup, if desired.

Specified by:
  `preInstantiateSingletons` in interface `ConfigurableListableBeanFactory`
Throws:
  `BeansException` - if one of the singleton beans could not be created. Note: This may have left the factory with some beans already initialized! Call `ConfigurableBeanFactory.destroySingletons()` for full cleanup in this case.
See Also:
  - `ConfigurableListableBeanFactory.prepareSingletonBootstrap()`
  - `ConfigurableBeanFactory.destroySingletons()`

### registerBeanDefinition

public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) throws BeanDefinitionStoreException
Description copied from interface: `BeanDefinitionRegistry`
Register a new bean definition with this registry. Must support RootBeanDefinition and ChildBeanDefinition.

Specified by:
  `registerBeanDefinition` in interface `BeanDefinitionRegistry`
Parameters:
  `beanName` - the name of the bean instance to register
  `beanDefinition` - definition of the bean instance to register
Throws:
  `BeanDefinitionStoreException` - if the BeanDefinition is invalid
  `BeanDefinitionOverrideException` - if there is already a BeanDefinition for the specified bean name and we are not allowed to override it
See Also:
  - `GenericBeanDefinition`
  - `RootBeanDefinition`
  - `ChildBeanDefinition`

### removeBeanDefinition

public void removeBeanDefinition(String beanName) throws NoSuchBeanDefinitionException
Description copied from interface: `BeanDefinitionRegistry`
Remove the BeanDefinition for the given name.

Specified by:
  `removeBeanDefinition` in interface `BeanDefinitionRegistry`
Parameters:
  `beanName` - the name of the bean instance to register
Throws:
  `NoSuchBeanDefinitionException` - if there is no such bean definition

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

Called after an existing bean definition has been replaced or removed, triggering `clearMergedBeanDefinition(java.lang.String)`, `destroySingleton(java.lang.String)` and `MergedBeanDefinitionPostProcessor.resetBeanDefinition(java.lang.String)` on the given bean and on all bean definitions that have the given bean as parent.

Parameters:
  `beanName` - the name of the bean to reset
See Also:
  - `registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)`
  - `removeBeanDefinition(java.lang.String)`

### isBeanDefinitionOverridable

public boolean isBeanDefinitionOverridable(String beanName)
This implementation returns `true` if bean definition overriding is generally allowed.

Specified by:
  `isBeanDefinitionOverridable` in interface `BeanDefinitionRegistry`
Parameters:
  `beanName` - the name to check
Returns:
  whether the definition for the given bean name is overridable
See Also:
  - `setAllowBeanDefinitionOverriding(boolean)`

### allowAliasOverriding

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

Overrides:
  `allowAliasOverriding` in class `org.springframework.core.SimpleAliasRegistry`
See Also:
  - `setAllowBeanDefinitionOverriding(boolean)`

### checkForAliasCircle

protected void checkForAliasCircle(String name, String alias)
Also checks for an alias overriding a bean definition of the same name.

Overrides:
  `checkForAliasCircle` in class `org.springframework.core.SimpleAliasRegistry`

### addSingleton

protected void addSingleton(String beanName, Object singletonObject)
Description copied from class: `DefaultSingletonBeanRegistry`
Add the given singleton object to the singleton registry.

To be called for exposure of freshly registered/created singletons.

Overrides:
  `addSingleton` in class `DefaultSingletonBeanRegistry`
Parameters:
  `beanName` - the name of the bean
  `singletonObject` - the singleton object

### registerSingleton

public void registerSingleton(String beanName, Object singletonObject) throws IllegalStateException
Description copied from interface: `SingletonBeanRegistry`
Register the given existing object as singleton in the bean registry, under the given bean name.

The given instance is supposed to be fully initialized; the registry will not perform any initialization callbacks (in particular, it won't call InitializingBean's `afterPropertiesSet` method). The given instance will not receive any destruction callbacks (like DisposableBean's `destroy` method) either.

When running within a full BeanFactory: Register a bean definition instead of an existing instance if your bean is supposed to receive initialization and/or destruction callbacks.

Typically invoked during registry configuration, but can also be used for runtime registration of singletons. As a consequence, a registry implementation should synchronize singleton access; it will have to do this anyway if it supports a BeanFactory's lazy initialization of singletons.

Specified by:
  `registerSingleton` in interface `SingletonBeanRegistry`
Overrides:
  `registerSingleton` in class `DefaultSingletonBeanRegistry`
Parameters:
  `beanName` - the name of the bean
  `singletonObject` - the existing singleton object
Throws:
  `IllegalStateException`
See Also:
  - `InitializingBean.afterPropertiesSet()`
  - `DisposableBean.destroy()`
  - `BeanDefinitionRegistry.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)`

### destroySingletons

public void destroySingletons()
Description copied from interface: `ConfigurableBeanFactory`
Destroy all singleton beans in this factory, including inner beans that have been registered as disposable. To be called on shutdown of a factory.

Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.

Specified by:
  `destroySingletons` in interface `ConfigurableBeanFactory`
Overrides:
  `destroySingletons` in class `DefaultSingletonBeanRegistry`

### destroySingleton

public void destroySingleton(String beanName)
Description copied from class: `DefaultSingletonBeanRegistry`
Destroy the given bean. Delegates to `destroyBean` if a corresponding disposable bean instance is found.

Overrides:
  `destroySingleton` in class `DefaultSingletonBeanRegistry`
Parameters:
  `beanName` - the name of the bean
See Also:
  - `DefaultSingletonBeanRegistry.destroyBean(java.lang.String, org.springframework.beans.factory.DisposableBean)`

### resolveNamedBean

public <T> NamedBeanHolder<T> resolveNamedBean(Class<T> requiredType) throws BeansException
Description copied from interface: `AutowireCapableBeanFactory`
Resolve the bean instance that uniquely matches the given object type, if any, including its bean name.

This is effectively a variant of `BeanFactory.getBean(Class)` which preserves the bean name of the matching instance.

Specified by:
  `resolveNamedBean` in interface `AutowireCapableBeanFactory`
Parameters:
  `requiredType` - type the bean must match; can be an interface or superclass
Returns:
  the bean name plus bean instance
Throws:
  `NoSuchBeanDefinitionException` - if no matching bean was found
  `NoUniqueBeanDefinitionException` - if more than one matching bean was found
  `BeansException` - if the bean could not be created
See Also:
  - `BeanFactory.getBean(Class)`

### resolveDependency

@Nullable public Object resolveDependency(DependencyDescriptor descriptor, @Nullable String requestingBeanName, @Nullable Set<String> autowiredBeanNames, @Nullable TypeConverter typeConverter) throws BeansException
Description copied from interface: `AutowireCapableBeanFactory`
Resolve the specified dependency against the beans defined in this factory.

Specified by:
  `resolveDependency` in interface `AutowireCapableBeanFactory`
Parameters:
  `descriptor` - the descriptor for the dependency (field/method/constructor)
  `requestingBeanName` - the name of the bean which declares the given dependency
  `autowiredBeanNames` - a Set that all names of autowired beans (used for resolving the given dependency) are supposed to be added to
  `typeConverter` - the TypeConverter to use for populating arrays and collections
Returns:
  the resolved object, or `null` if none found
Throws:
  `NoSuchBeanDefinitionException` - if no matching bean was found
  `NoUniqueBeanDefinitionException` - if more than one matching bean was found
  `BeansException` - if dependency resolution failed for any other reason
See Also:
  - `DependencyDescriptor`

### doResolveDependency

@Nullable public Object doResolveDependency(DependencyDescriptor descriptor, @Nullable String beanName, @Nullable Set<String> autowiredBeanNames, @Nullable TypeConverter typeConverter) throws BeansException

Throws:
  `BeansException`

### findAutowireCandidates

protected Map<String,Object> findAutowireCandidates(@Nullable String beanName, Class<?> requiredType, 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:
  `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[])`

### determineAutowireCandidate

@Nullable protected String determineAutowireCandidate(Map<String,Object> candidates, DependencyDescriptor descriptor)
Determine the autowire candidate in the given set of beans.

Looks for `@Primary` and `@Priority` (in that order).

Parameters:
  `candidates` - 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 autowire candidate, or `null` if none found

### determinePrimaryCandidate

@Nullable protected String determinePrimaryCandidate(Map<String,Object> candidates, Class<?> requiredType)
Determine the primary candidate in the given set of beans.

Parameters:
  `candidates` - a Map of candidate names and candidate instances (or candidate classes if not created yet) that match the required type
  `requiredType` - the target dependency type to match against
Returns:
  the name of the primary candidate, or `null` if none found
See Also:
  - `isPrimary(String, Object)`

### determineHighestPriorityCandidate

@Nullable protected String determineHighestPriorityCandidate(Map<String,Object> candidates, Class<?> requiredType)
Determine the candidate with the highest priority in the given set of beans.

Based on `@jakarta.annotation.Priority`. As defined by the related `Ordered` interface, the lowest value has the highest priority.

Parameters:
  `candidates` - a Map of candidate names and candidate instances (or candidate classes if not created yet) that match the required type
  `requiredType` - the target dependency type to match against
Returns:
  the name of the candidate with the highest priority, or `null` if none found
Throws:
  `NoUniqueBeanDefinitionException` - if multiple beans are detected with the same highest priority value
See Also:
  - `getPriority(Object)`

### 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 (can be `null`)
Returns:
  whether the given bean qualifies as primary

### getPriority

@Nullable protected Integer getPriority(Object beanInstance)
Return the priority assigned for the given bean instance by the `jakarta.annotation.Priority` annotation.

The default implementation delegates to the specified `dependency comparator`, checking its `method` if it is an extension of Spring's common `OrderComparator` - typically, an `AnnotationAwareOrderComparator`. If no such comparator is present, this implementation returns `null`.

Parameters:
  `beanInstance` - the bean instance to check (can be `null`)
Returns:
  the priority assigned to that bean or `null` if none is set

### matchesBeanName

protected boolean matchesBeanName(String beanName, @Nullable String dependencyName)
Determine whether the given dependency 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`