Custom Service Registry

If you wish to design your own implementation of a service registry, you will need to inject your implementation into CAS as such:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package org.apereo.cas.support;

@Configuration("myConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class MyConfiguration implements ServiceRegistryExecutionPlanConfigurer {

  @Bean
  @RefreshScope
  public ServiceRegistryDao serviceRegistry() {
      ...
  }
  
  @Override
  public void configureServiceRegistry(final ServiceRegistryExecutionPlan plan) {
    plan.registerServiceRegistry(serviceRegistry());
  }
}

At a minimum, your overlay will need to include the following modules:

1
2
3
4
5
<dependency>
     <groupId>org.apereo.cas</groupId>
     <artifactId>cas-server-core-services</artifactId>
     <version>${cas.version}</version>
</dependency>

See this guide to learn more about how to register configurations into the CAS runtime.