类 FactoryBeanRegistrySupport
- java.lang.Object
- org.springframework.core.SimpleAliasRegistry
- org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
- org.springframework.beans.factory.support.FactoryBeanRegistrySupport
- 所有已实现的接口:
SingletonBeanRegistry
,AliasRegistry
- 直接已知子类:
AbstractBeanFactory
public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanRegistry
Support base class for singleton registries which need to handleFactoryBean
instances, integrated withDefaultSingletonBeanRegistry
's singleton management.Serves as base class for
AbstractBeanFactory
.- 从以下版本开始:
- 2.5.1
- 作者:
- Juergen Hoeller
字段概要
从类继承的字段 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
logger, NULL_OBJECT
构造器概要
构造器 构造器 说明 FactoryBeanRegistrySupport()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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.从类继承的方法 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
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
从类继承的方法 org.springframework.core.SimpleAliasRegistry
allowAliasOverriding, canonicalName, checkForAliasCircle, getAliases, hasAlias, isAlias, registerAlias, removeAlias, resolveAliases
构造器详细资料
FactoryBeanRegistrySupport
public FactoryBeanRegistrySupport()
方法详细资料
getTypeForFactoryBean
protected Class<?> getTypeForFactoryBean(FactoryBean<?> factoryBean)
Determine the type for the given FactoryBean.- 参数:
factoryBean
- the FactoryBean instance to check- 返回:
- the FactoryBean's object type, or
null
if the type cannot be determined yet
getCachedObjectForFactoryBean
protected Object getCachedObjectForFactoryBean(String beanName)
Obtain an object to expose from the given FactoryBean, if available in cached form. Quick check for minimal synchronization.- 参数:
beanName
- the name of the bean- 返回:
- the object obtained from the FactoryBean, or
null
if not available
getObjectFromFactoryBean
protected Object getObjectFromFactoryBean(FactoryBean<?> factory, String beanName, boolean shouldPostProcess)
Obtain an object to expose from the given FactoryBean.- 参数:
factory
- the FactoryBean instancebeanName
- the name of the beanshouldPostProcess
- whether the bean is subject to post-processing- 返回:
- the object obtained from the FactoryBean
- 抛出:
BeanCreationException
- if FactoryBean object creation failed- 另请参阅:
FactoryBean.getObject()
postProcessObjectFromFactoryBean
protected Object postProcessObjectFromFactoryBean(Object object, String beanName) throws BeansException
Post-process the given object that has been obtained from the FactoryBean. The resulting object will get exposed for bean references.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 bean- 返回:
- the object to expose
- 抛出:
BeansException
- if any post-processing failed
getFactoryBean
protected FactoryBean<?> getFactoryBean(String beanName, Object beanInstance) throws BeansException
Get a FactoryBean for the given bean if possible.- 参数:
beanName
- the name of the beanbeanInstance
- the corresponding bean instance- 返回:
- the bean instance as FactoryBean
- 抛出:
BeansException
- if the given bean cannot be exposed as a FactoryBean
removeSingleton
protected void removeSingleton(String beanName)
Overridden to clear the FactoryBean object cache as well.- 覆盖:
removeSingleton
在类中DefaultSingletonBeanRegistry
- 参数:
beanName
- the name of the bean- 另请参阅:
DefaultSingletonBeanRegistry.getSingletonMutex()
clearSingletonCache
protected void clearSingletonCache()
Overridden to clear the FactoryBean object cache as well.
getAccessControlContext
protected AccessControlContext getAccessControlContext()
Return the security context for this bean factory. If a security manager is set, interaction with the user code will be executed using the privileged of the security context returned by this method.