I have initialization code that I want to run after Spring has refreshed all ApplicationContexts.
Right now I have an instance of ApplicationListener<ContextRefreshedEvent> that listens for when my contexts are done, but it gets called for every context in my application.
How can I listen for the very last one?
I've tried to listen for the root using event.getApplicationContext().getParent() == null but this is not the last context to load.