private void registerLifecycle(Environment environment) {

        Map<String, LifeCycle> beansOfType = applicationContext.getBeansOfType(LifeCycle.class);

        for (String beanName : beansOfType.keySet()) {

            LifeCycle lifeCycle = beansOfType.get(beanName);

            environment.lifecycle().manage(lifeCycle);

            logger.info("Registering lifeCycle: " + lifeCycle.getClass().getName());
        }
    }