Interface ServiceRegistry

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
DefaultServiceRegistry

@Incubating public interface ServiceRegistry extends Closeable
Registry of Debezium Services.
Author:
Chris Cranford
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the service registry.
    <T extends Service>
    T
    getService(Class<T> serviceClass)
    Get a service by class type.
    <T extends Service>
    void
    Register a service provider with the service registry.
    default <T extends Service>
    T
    tryGetService(Class<T> serviceClass)
    Safely get a service if it exists, or null if it does not.
  • Method Details

    • getService

      <T extends Service> T getService(Class<T> serviceClass)
      Get a service by class type.
      Type Parameters:
      T - the service class type
      Parameters:
      serviceClass - the service class
      Returns:
      the requested service
      Throws:
      UnknownServiceException - if the requested service is not found
    • tryGetService

      default <T extends Service> T tryGetService(Class<T> serviceClass)
      Safely get a service if it exists, or null if it does not.
      Type Parameters:
      T - the service class type
      Parameters:
      serviceClass - the service class
      Returns:
      the requested service or null if the service was not found
    • registerServiceProvider

      <T extends Service> void registerServiceProvider(ServiceProvider<T> serviceProvider)
      Register a service provider with the service registry. A provider allows the construction and resolution of services lazily upon first request and use.
      Type Parameters:
      T - the service type
      Parameters:
      serviceProvider - the service provider, should not be null
    • close

      void close()
      Closes the service registry.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable