Package io.debezium.service.spi
Interface ServiceProvider<T extends Service>
- All Known Implementing Classes:
PostProcessorRegistryServiceProvider
A contract that defines how a service is provided to the
ServiceRegistry
.
It is not uncommon for different objects to have various levels of dependency between one
another in a system, and the ServiceProvider
allows for the separation of the
service registration and the service construction.
In essence, the provider is registered with the service registry. Then as services are
initialized, they'll request other services that may not have been initialized, and the
provider will be called to create such services. This allows the creation of the all
services based on their dependency order, and we can in turn tear down the registry in
reverse dependency order.- Author:
- Chris Cranford
-
Method Summary
Modifier and TypeMethodDescriptioncreateService
(Configuration configuration, ServiceRegistry serviceRegistry) Creates or provides a desired service.Get the service class that should be initiated or provided.
-
Method Details
-
getServiceClass
Get the service class that should be initiated or provided. The service class should be unique in the registry.- Returns:
- the service class
-
createService
Creates or provides a desired service.- Parameters:
configuration
- the connector configurationserviceRegistry
- the service registry- Returns:
- the constructed service
-