org.springframework.beans.factory

## 接口 BeanFactoryAware

- 所有超级接口:
    Aware
  所有已知实现类:
    AbstractFactoryBean, AbstractServiceLoaderBasedFactoryBean, AutowiredAnnotationBeanPostProcessor, BeanConfigurerSupport, GenericTypeAwareAutowireCandidateResolver, ListFactoryBean, MapFactoryBean, MethodInvokingBean, MethodInvokingFactoryBean, ObjectFactoryCreatingFactoryBean, PlaceholderConfigurerSupport, PreferencesPlaceholderConfigurer, PropertyPathFactoryBean, PropertyPlaceholderConfigurer, ProviderCreatingFactoryBean, QualifierAnnotationAutowireCandidateResolver, RequiredAnnotationBeanPostProcessor, ServiceFactoryBean, ServiceListFactoryBean, ServiceLoaderFactoryBean, ServiceLocatorFactoryBean, SetFactoryBean

      public interface BeanFactoryAware
      extends Aware

  Interface to be implemented by beans that wish to be aware of their owning `BeanFactory`.

  For example, beans can look up collaborating beans via the factory (Dependency Lookup). Note that most beans will choose to receive references to collaborating beans via corresponding bean properties or constructor arguments (Dependency Injection).

  For a list of all bean lifecycle methods, see the `BeanFactory javadocs`.

  从以下版本开始:
    11.03.2003
  作者:
    Rod Johnson, Chris Beams
  另请参阅:
    `BeanNameAware`, `BeanClassLoaderAware`, `InitializingBean`, `org.springframework.context.ApplicationContextAware`

- - ### 方法概要

    所有方法 实例方法 抽象方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `setBeanFactory(BeanFactory beanFactory)` Callback that supplies the owning factory to a bean instance.

- - ### 方法详细资料

    - #### setBeanFactory

          void setBeanFactory(BeanFactory beanFactory)
                       throws BeansException

      Callback that supplies the owning factory to a bean instance.

      Invoked after the population of normal bean properties but before an initialization callback such as `InitializingBean.afterPropertiesSet()` or a custom init-method.

      参数:
        `beanFactory` - owning BeanFactory (never `null`). The bean can immediately call methods on the factory.
      抛出:
        `BeansException` - in case of initialization errors
      另请参阅:
        `BeanInitializationException`