Class ServiceRegistration<T extends Service>

java.lang.Object
io.debezium.service.ServiceRegistration<T>

public final class ServiceRegistration<T extends Service> extends Object
Describes a registration for a specific service.
Author:
Chris Cranford
  • Field Details

  • Constructor Details

    • ServiceRegistration

      public ServiceRegistration(Class<T> serviceClass, T service)
      Create a service registration for an already existing service instance.
      Parameters:
      serviceClass - the service class
      service - the service instance
    • ServiceRegistration

      public ServiceRegistration(ServiceProvider<T> serviceProvider)
      Create a service registration where the service will be initialized on first-use.
      Parameters:
      serviceProvider - the service provider
  • Method Details

    • getServiceClass

      public Class<T> getServiceClass()
      Get the service class type
      Returns:
      the class type, never null
    • getServiceProvider

      public ServiceProvider<T> getServiceProvider()
      Get the service provider
      Returns:
      the service provider, may be null
    • getService

      public T getService()
      Get the service instance.
      Returns:
      the service instance, may be null if initialized
    • setService

      public void setService(T service)
      Set the service once initialized, used by ServiceProvider registrations.
      Parameters:
      service - the service instance, should not be null