From 3a34cdba8153b8085649feb38b9883f3e96e195c Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 26 Oct 2016 09:49:50 +0200 Subject: [PATCH] Polish contribution Closes gh-1203 --- .../beans/factory/BeanFactory.java | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java index 017451056e..f3e418abb2 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/BeanFactory.java @@ -63,31 +63,35 @@ import org.springframework.core.ResolvableType; * are supposed to override beans of the same name in any parent factory. * *

Bean factory implementations should support the standard bean lifecycle interfaces - * as far as possible. The full set of initialization methods and their standard order is:
- * 1. BeanNameAware's {@code setBeanName}
- * 2. BeanClassLoaderAware's {@code setBeanClassLoader}
- * 3. BeanFactoryAware's {@code setBeanFactory}
- * 4. EnvironmentAware's {@code setEnvironment}
- * 5. EmbeddedValueResolverAware's {@code setEmbeddedValueResolver}
- * 6. ResourceLoaderAware's {@code setResourceLoader} - * (only applicable when running in an application context)
- * 7. ApplicationEventPublisherAware's {@code setApplicationEventPublisher} - * (only applicable when running in an application context)
- * 8. MessageSourceAware's {@code setMessageSource} - * (only applicable when running in an application context)
- * 9. ApplicationContextAware's {@code setApplicationContext} - * (only applicable when running in an application context)
- * 10. ServletContextAware's {@code setServletContext} - * (only applicable when running in a web application context)
- * 11. {@code postProcessBeforeInitialization} methods of BeanPostProcessors
- * 12. InitializingBean's {@code afterPropertiesSet}
- * 13. a custom init-method definition
- * 14. {@code postProcessAfterInitialization} methods of BeanPostProcessors + * as far as possible. The full set of initialization methods and their standard order is: + *

    + *
  1. BeanNameAware's {@code setBeanName} + *
  2. BeanClassLoaderAware's {@code setBeanClassLoader} + *
  3. BeanFactoryAware's {@code setBeanFactory} + *
  4. EnvironmentAware's {@code setEnvironment} + *
  5. EmbeddedValueResolverAware's {@code setEmbeddedValueResolver} + *
  6. ResourceLoaderAware's {@code setResourceLoader} + * (only applicable when running in an application context) + *
  7. ApplicationEventPublisherAware's {@code setApplicationEventPublisher} + * (only applicable when running in an application context) + *
  8. MessageSourceAware's {@code setMessageSource} + * (only applicable when running in an application context) + *
  9. ApplicationContextAware's {@code setApplicationContext} + * (only applicable when running in an application context) + *
  10. ServletContextAware's {@code setServletContext} + * (only applicable when running in a web application context) + *
  11. {@code postProcessBeforeInitialization} methods of BeanPostProcessors + *
  12. InitializingBean's {@code afterPropertiesSet} + *
  13. a custom init-method definition + *
  14. {@code postProcessAfterInitialization} methods of BeanPostProcessors + *
* - *

On shutdown of a bean factory, the following lifecycle methods apply:
- * 1. {@code postProcessBeforeDestruction} methods of DestructionAwareBeanPostProcessors - * 2. DisposableBean's {@code destroy}
- * 3. a custom destroy-method definition + *

On shutdown of a bean factory, the following lifecycle methods apply: + *

    + *
  1. {@code postProcessBeforeDestruction} methods of DestructionAwareBeanPostProcessors + *
  2. DisposableBean's {@code destroy} + *
  3. a custom destroy-method definition + *
* * @author Rod Johnson * @author Juergen Hoeller