org.springframework.beans.factory.support

## 类 FactoryBeanRegistrySupport

- java.lang.Object
- - org.springframework.core.SimpleAliasRegistry
  - - org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
    - - org.springframework.beans.factory.support.FactoryBeanRegistrySupport

- 所有已实现的接口:
    SingletonBeanRegistry, org.springframework.core.AliasRegistry
  直接已知子类:
    AbstractBeanFactory

      public abstract class FactoryBeanRegistrySupport
      extends DefaultSingletonBeanRegistry

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

  Serves as base class for `AbstractBeanFactory`.

  从以下版本开始:
    2.5.1
  作者:
    Juergen Hoeller

- - ### 字段概要

    - ### 从类继承的字段 org.springframework.core.SimpleAliasRegistry

      `logger`

  - ### 构造器概要

    构造器
    构造器和说明
    `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`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### FactoryBeanRegistrySupport

          public FactoryBeanRegistrySupport()

  - ### 方法详细资料

    - #### getTypeForFactoryBean

          @Nullable
          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

          @Nullable
          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 instance
        `beanName` - the name of the bean
        `shouldPostProcess` - 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 bean
        `beanInstance` - 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.
      覆盖:
        `clearSingletonCache` 在类中 `DefaultSingletonBeanRegistry`

    - #### 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.
      另请参阅:
        `AccessController.getContext()`