public abstract class

FactoryBeanRegistrySupport

extends DefaultSingletonBeanRegistry
java.lang.Object
   ↳ org.springframework.core.SimpleAliasRegistry
     ↳ org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
       ↳ org.springframework.beans.factory.support.FactoryBeanRegistrySupport
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Support base class for singleton registries which need to handle FactoryBean instances, integrated with DefaultSingletonBeanRegistry's singleton management.

Serves as base class for AbstractBeanFactory.

Summary

[Expand]
Inherited Fields
From class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
Public Constructors
FactoryBeanRegistrySupport()
Protected Methods
AccessControlContext getAccessControlContext()
Returns the security context for this bean factory.
Object getCachedObjectForFactoryBean(String beanName)
Obtain an object to expose from the given FactoryBean, if available in cached form.
FactoryBean getFactoryBean(String beanName, Object beanInstance)
Get a FactoryBean for the given bean if possible.
Object getObjectFromFactoryBean(FactoryBean factory, String beanName, boolean shouldPostProcess)
Obtain an object to expose from the given FactoryBean.
Class getTypeForFactoryBean(FactoryBean factoryBean)
Determine the type for the given FactoryBean.
Object postProcessObjectFromFactoryBean(Object object, String beanName)
Post-process the given object that has been obtained from the FactoryBean.
void removeSingleton(String beanName)
Overridden to clear the FactoryBean object cache as well.
[Expand]
Inherited Methods
From class org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
From class org.springframework.core.SimpleAliasRegistry
From class java.lang.Object
From interface org.springframework.beans.factory.config.SingletonBeanRegistry
From interface org.springframework.core.AliasRegistry

Public Constructors

public FactoryBeanRegistrySupport ()

Also: SpringBeans

Protected Methods

protected AccessControlContext getAccessControlContext ()

Also: SpringBeans

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

See Also

protected Object getCachedObjectForFactoryBean (String beanName)

Also: SpringBeans

Obtain an object to expose from the given FactoryBean, if available in cached form. Quick check for minimal synchronization.

Parameters
beanName the name of the bean
Returns
  • the object obtained from the FactoryBean, or null if not available

protected FactoryBean getFactoryBean (String beanName, Object beanInstance)

Also: SpringBeans

Get a FactoryBean for the given bean if possible.

Parameters
beanName the name of the bean
beanInstance the corresponding bean instance
Returns
  • the bean instance as FactoryBean
Throws
BeansException if the given bean cannot be exposed as a FactoryBean

protected Object getObjectFromFactoryBean (FactoryBean factory, String beanName, boolean shouldPostProcess)

Also: SpringBeans

Obtain an object to expose from the given FactoryBean.

Parameters
factory the FactoryBean instance
beanName the name of the bean
shouldPostProcess whether the bean is subject for post-processing
Returns
  • the object obtained from the FactoryBean
Throws
BeanCreationException if FactoryBean object creation failed
See Also

protected Class getTypeForFactoryBean (FactoryBean factoryBean)

Also: SpringBeans

Determine the type for the given FactoryBean.

Parameters
factoryBean the FactoryBean instance to check
Returns
  • the FactoryBean's object type, or null if the type cannot be determined yet

protected Object postProcessObjectFromFactoryBean (Object object, String beanName)

Also: SpringBeans

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.

Parameters
object the object obtained from the FactoryBean.
beanName the name of the bean
Returns
  • the object to expose
Throws
BeansException if any post-processing failed

protected void removeSingleton (String beanName)

Also: SpringBeans

Overridden to clear the FactoryBean object cache as well.

Parameters
beanName the name of the bean