if (SpringContextSingleton.getInstance().isInitialized()) {
Map map = SpringContextSingleton.getInstance().getContext().getBeansOfType(
JahiaAfterInitializationService.class);
for (Object o : map.values()) {
JahiaAfterInitializationService initializationService = (JahiaAfterInitializationService) o;
initializationService.initAfterAllServicesAreStarted();
}
if (SpringContextSingleton.getInstance().getModuleContext() != null) {
map = SpringContextSingleton.getInstance().getModuleContext().getBeansOfType(
JahiaAfterInitializationService.class);
for (Object o : map.values()) {
JahiaAfterInitializationService initializationService = (JahiaAfterInitializationService) o;
initializationService.initAfterAllServicesAreStarted();
}
} else {
logger.error("Modules Spring application context failed to start. Unable to initialize services");
}
}