@Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        @Lazy(false)
        public ServiceRegistryInitializer serviceRegistryInitializer(
            final ConfigurableApplicationContext applicationContext,
            @Qualifier("embeddedJsonServiceRegistry")
            final ServiceRegistry embeddedJsonServiceRegistry,
            @Qualifier(ServicesManager.BEAN_NAME)
            final ServicesManager servicesManager,
            @Qualifier(ServiceRegistry.BEAN_NAME)
            final ChainingServiceRegistry serviceRegistry) {
            return BeanSupplier.of(ServiceRegistryInitializer.class)
                .when(CONDITION.given(applicationContext.getEnvironment()))
                .supply(() -> new DefaultServiceRegistryInitializer(embeddedJsonServiceRegistry, serviceRegistry, servicesManager))
                .otherwiseProxy()
                .get();
        }
This is {@link CasServiceRegistryInitializationConfiguration}.

@author Misagh Moayyed
@since 5.2.0
core/cas-server-core-services/src/main/java/org/apereo/cas/config/CasServiceRegistryInitializationConfiguration.java