Search in sources :

Example 1 with ServiceRegistry

use of org.apereo.cas.services.ServiceRegistry in project cas by apereo.

the class CasServiceRegistryInitializationConfiguration method serviceRegistryInitializer.

@RefreshScope
@Bean
public ServiceRegistryInitializer serviceRegistryInitializer() {
    final ServiceRegistryProperties props = casProperties.getServiceRegistry();
    final ServiceRegistry serviceRegistryInstance = serviceRegistry.getIfAvailable();
    final ServiceRegistryInitializer initializer = new ServiceRegistryInitializer(embeddedJsonServiceRegistry(), serviceRegistryInstance, servicesManager.getIfAvailable(), props.isInitFromJson());
    if (props.isInitFromJson()) {
        LOGGER.info("Attempting to initialize the service registry [{}] from service definition resources found at [{}]", serviceRegistryInstance.getName(), getServiceRegistryInitializerServicesDirectoryResource());
    }
    initializer.initServiceRegistryIfNecessary();
    return initializer;
}
Also used : ServiceRegistryInitializer(org.apereo.cas.services.ServiceRegistryInitializer) ServiceRegistryProperties(org.apereo.cas.configuration.model.core.services.ServiceRegistryProperties) JsonServiceRegistryProperties(org.apereo.cas.configuration.model.support.services.json.JsonServiceRegistryProperties) AbstractResourceBasedServiceRegistry(org.apereo.cas.services.resource.AbstractResourceBasedServiceRegistry) ServiceRegistry(org.apereo.cas.services.ServiceRegistry) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Aggregations

ServiceRegistryProperties (org.apereo.cas.configuration.model.core.services.ServiceRegistryProperties)1 JsonServiceRegistryProperties (org.apereo.cas.configuration.model.support.services.json.JsonServiceRegistryProperties)1 ServiceRegistry (org.apereo.cas.services.ServiceRegistry)1 ServiceRegistryInitializer (org.apereo.cas.services.ServiceRegistryInitializer)1 AbstractResourceBasedServiceRegistry (org.apereo.cas.services.resource.AbstractResourceBasedServiceRegistry)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Bean (org.springframework.context.annotation.Bean)1