private void registerManaged(Environment environment) {

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

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

            Managed managed = beansOfType.get(beanName);
            environment.lifecycle().manage(managed);

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