public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanRegistry
FactoryBean
instances,
integrated with DefaultSingletonBeanRegistry
's singleton management.
Serves as base class for AbstractBeanFactory
.
logger, NULL_OBJECT
Constructor and Description |
---|
FactoryBeanRegistrySupport() |
Modifier and Type | Method and Description |
---|---|
protected void |
clearSingletonCache()
Overridden to clear the FactoryBean object cache as well.
|
protected AccessControlContext |
getAccessControlContext()
Return the security context for this bean factory.
|
protected Object |
getCachedObjectForFactoryBean(String beanName)
Obtain an object to expose from the given FactoryBean, if available
in cached form.
|
protected FactoryBean<?> |
getFactoryBean(String beanName,
Object beanInstance)
Get a FactoryBean for the given bean if possible.
|
protected Object |
getObjectFromFactoryBean(FactoryBean<?> factory,
String beanName,
boolean shouldPostProcess)
Obtain an object to expose from the given FactoryBean.
|
protected Class<?> |
getTypeForFactoryBean(FactoryBean<?> factoryBean)
Determine the type for the given FactoryBean.
|
protected Object |
postProcessObjectFromFactoryBean(Object object,
String beanName)
Post-process the given object that has been obtained from the FactoryBean.
|
protected void |
removeSingleton(String beanName)
Overridden to clear the FactoryBean object cache as well.
|
addSingleton, addSingletonFactory, afterSingletonCreation, beforeSingletonCreation, containsSingleton, destroyBean, destroySingleton, destroySingletons, getDependenciesForBean, getDependentBeans, getSingleton, getSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, hasDependentBean, isActuallyInCreation, isCurrentlyInCreation, isDependent, isSingletonCurrentlyInCreation, onSuppressedException, registerContainedBean, registerDependentBean, registerDisposableBean, registerSingleton, setCurrentlyInCreation
allowAliasOverriding, canonicalName, checkForAliasCircle, getAliases, hasAlias, isAlias, registerAlias, removeAlias, resolveAliases
protected Class<?> getTypeForFactoryBean(FactoryBean<?> factoryBean)
factoryBean
- the FactoryBean instance to checknull
if the type cannot be determined yetprotected Object getCachedObjectForFactoryBean(String beanName)
beanName
- the name of the beannull
if not availableprotected Object getObjectFromFactoryBean(FactoryBean<?> factory, String beanName, boolean shouldPostProcess)
factory
- the FactoryBean instancebeanName
- the name of the beanshouldPostProcess
- whether the bean is subject to post-processingBeanCreationException
- if FactoryBean object creation failedFactoryBean.getObject()
protected Object postProcessObjectFromFactoryBean(Object object, String beanName) throws BeansException
The default implementation simply returns the given object as-is. Subclasses may override this, for example, to apply post-processors.
object
- the object obtained from the FactoryBean.beanName
- the name of the beanBeansException
- if any post-processing failedprotected FactoryBean<?> getFactoryBean(String beanName, Object beanInstance) throws BeansException
beanName
- the name of the beanbeanInstance
- the corresponding bean instanceBeansException
- if the given bean cannot be exposed as a FactoryBeanprotected void removeSingleton(String beanName)
removeSingleton
in class DefaultSingletonBeanRegistry
beanName
- the name of the beanDefaultSingletonBeanRegistry.getSingletonMutex()
protected void clearSingletonCache()
clearSingletonCache
in class DefaultSingletonBeanRegistry
protected AccessControlContext getAccessControlContext()
AccessController.getContext()