- Custom Service implements InitializingBean, DisposableBean to define afterPropertiesSet() and destroy() methods for respective interfaces. It also has @PostConstruct and @PreDestroy methods
- In application class, customService2 Bean is defined with configuration providing init-method and destroy-methods.
- Running the application shows the sequence in which methods are called
- Import project as Maven project
- Run application as Spring Boot Application
- Observe log to see the sequence of execution