Skip to content
This repository has been archived by the owner on Jul 22, 2019. It is now read-only.

nekolr/spring-life-cycle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring bean生命周期图

Spring bean生命周期

  • The full set of initialization methods and their standard order is

    1. BeanNameAware's setBeanName
    2. BeanClassLoaderAware's setBeanClassLoader
    3. BeanFactoryAware's setBeanFactory
    4. EnvironmentAware's setEnvironment
    5. EmbeddedValueResolverAware's setEmbeddedValueResolver
    6. ResourceLoaderAware's setResourceLoader (only applicable when running in an application context)
    7. ApplicationEventPublisherAware's setApplicationEventPublisher (only applicable when running in an application context)
    8. MessageSourceAware's setMessageSource (only applicable when running in an application context)
    9. ApplicationContextAware's setApplicationContext (only applicable when running in an application context)
    10. ServletContextAware's setServletContext (only applicable when running in a web application context)
    11. postProcessBeforeInitialization methods of BeanPostProcessors
    12. InitializingBean's afterPropertiesSet
    13. a custom init-method definition
    14. postProcessAfterInitialization methods of BeanPostProcessors
  • On shutdown of a bean factory, the following lifecycle methods apply

    1. postProcessBeforeDestruction methods of DestructionAwareBeanPostProcessors
    2. DisposableBean's destroy
    3. a custom destroy-method definition

Spring IoC容器剖析

Spring IoC容器剖析

About

🌱 Life is short , why use spring?!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages