1
JavaIntermediate#spring
Instantiate → populate properties → BeanNameAware/BeanFactoryAware → postProcessBeforeInitialization → @PostConstruct / afterPropertiesSet / custom init → postProcessAfterInitialization → use → @PreDestroy / destroy.
@Component
class MyBean {
@PostConstruct void init() { System.out.println("initialized"); }
@PreDestroy void cleanup() { System.out.println("destroyed"); }
}