Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Spring Initialzation and Destruction lifecycle callbacks example

How is it configured in example

  1. Custom Service implements InitializingBean, DisposableBean to define afterPropertiesSet() and destroy() methods for respective interfaces. It also has @PostConstruct and @PreDestroy methods
  2. In application class, customService2 Bean is defined with configuration providing init-method and destroy-methods.
  3. Running the application shows the sequence in which methods are called

Importing and running project

  1. Import project as Maven project
  2. Run application as Spring Boot Application
  3. Observe log to see the sequence of execution

About

Example of Initialization and destruction lifecycle callbacks

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages