Hard java spring

14. What is the complete lifecycle of a Spring Bean?

Sample answer: "Instantiate, then inject dependencies, then Aware callbacks like BeanNameAware. Then BeanPostProcessor before-init, then init: @PostConstruct, afterPropertiesSet(), custom init-method. Then BeanPostProcessor after-init, which is where AOP proxies are made. On shutdown: @PreDestroy, destroy(), custom destroy-method."

Follow-up: Why does @Transactional not work on a self-call? (The proxy is created in the post-processor, and a self-call bypasses it.)

Sources (2)
  1. Customizing the nature of a bean: lifecycle callbacks
  2. Container extension points: BeanPostProcessor