org.springframework.beans.factory

## 接口 InitializingBean

- 所有已知实现类:
    AbstractFactoryBean, AbstractServiceLoaderBasedFactoryBean, BeanConfigurerSupport, FieldRetrievingFactoryBean, ListFactoryBean, MapFactoryBean, MethodInvokingBean, MethodInvokingFactoryBean, ObjectFactoryCreatingFactoryBean, PreferencesPlaceholderConfigurer, PropertiesFactoryBean, ProviderCreatingFactoryBean, ServiceFactoryBean, ServiceListFactoryBean, ServiceLoaderFactoryBean, ServiceLocatorFactoryBean, SetFactoryBean, YamlMapFactoryBean, YamlPropertiesFactoryBean

      public interface InitializingBean

  Interface to be implemented by beans that need to react once all their properties have been set by a `BeanFactory`: e.g. to perform custom initialization, or merely to check that all mandatory properties have been set.

  An alternative to implementing `InitializingBean` is specifying a custom init method, for example in an XML bean definition. For a list of all bean lifecycle methods, see the `BeanFactory javadocs`.

  作者:
    Rod Johnson, Juergen Hoeller
  另请参阅:
    `DisposableBean`, `BeanDefinition.getPropertyValues()`, `AbstractBeanDefinition.getInitMethodName()`

- - ### 方法概要

    所有方法 实例方法 抽象方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `afterPropertiesSet()` Invoked by the containing `BeanFactory` after it has set all bean properties and satisfied `BeanFactoryAware`, `ApplicationContextAware` etc.

- - ### 方法详细资料

    - #### afterPropertiesSet

          void afterPropertiesSet()
                           throws Exception

      Invoked by the containing `BeanFactory` after it has set all bean properties and satisfied `BeanFactoryAware`, `ApplicationContextAware` etc.

      This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

      抛出:
        `Exception` - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason