@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        @Bean
        public ServiceRegistry embeddedJsonServiceRegistry(
            final CasConfigurationProperties casProperties,
            final ConfigurableApplicationContext applicationContext,
            final ObjectProvider<List<ServiceRegistryListener>> serviceRegistryListeners) {
            return BeanSupplier.of(ServiceRegistry.class)
                .when(CONDITION.given(applicationContext.getEnvironment()))
                .supply(Unchecked.supplier(() -> {
                    val location = getServiceRegistryInitializerServicesDirectoryResource(casProperties, applicationContext);
                    val registry = new EmbeddedResourceBasedServiceRegistry(applicationContext, location,
                        Optional.ofNullable(serviceRegistryListeners.getIfAvailable()).orElseGet(ArrayList::new), WatcherService.noOp());
                    if (!(location instanceof ClassPathResource) && casProperties.getServiceRegistry().getJson().isWatcherEnabled()) {
                        registry.enableDefaultWatcherService();
                    }
                    return registry;
                }))
                .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