/** * Method responsible for executed all Schedule after Spring initialize. */ @EventListener(ContextRefreshedEvent.class) public synchronized void initAfterBeans() { init(); contextRefreshed = true; toBeScheduled.forEach(this::internalSchedule); toBeScheduled.clear(); }