Examining life cycle messages

We read about the bean's life cycle; why don't we try to examine the life cycle?

Modify the HelloWorld class and implement the following Spring Framework interfaces:

  • ApplicationContextAware: This will ask you to implement the setApplicationContext method
  • BeanNameAware: This will tell you to implement the setBeanName method
  • InitializingBean: This will force you to implement the afterPropertiesSet() method
  • BeanFactoryAware: This will request you to implement the setBeanFactory method
  • BeanPostProcessor: This needs you to implement the postProcessBeforeInitialization and postProcessAfterInitialization methods
  • DisposableBean: This needs to implement the destroy() method

Add the System.out.println statement in all the implemented ...

Get Mockito for Spring now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.