Calling A Method After all SpringBeans and ApplicationContext have been initialized

java, spring

Solution

You may catch a `ContextRefreshedEvent` with `ApplicationListener`.

Problem

I have a method in a complex java program that needs to be called immediately after the web ApplicationContext and SpringBeans have been initialized. I've tried toying around with `<bean id="..." class="..." init-method="initialize">` but this method will call a `applicationContext.get().getBean(beanId);` method. I was wondering if anyone knows how to do this. Thank you.

Original source