I have a classX in my spring application in which I want to be able to find out if all spring beans have been initialized. To do this, I am trying to listen ContextRefreshedEven
You can use annotation-driven event listener as below :
@Component public class classX { @EventListener public void handleContextRefresh(ContextRefreshedEvent event) { } }
the ApplicationListener you want to register is defined in the signature of the method.