It is possible to define actions in the life cycle of a bean using
by @PostConstruct
@PostConstruct
by @OnDestroy
@OnDestroy
by @Init
@Init
of @Bean(initMethod = "anyMethodToCallAfterConstructorCall", destroyMethod = "myCleanUpMethod")
@Bean(initMethod = "anyMethodToCallAfterConstructorCall", destroyMethod = "myCleanUpMethod")
InitializingBean and DisposableBean interfaces
InitializingBean
DisposableBean