Package io.debezium.service.spi
Interface ServiceRegistry
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
DefaultServiceRegistry
Registry of Debezium Services.
- Author:
- Chris Cranford
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the service registry.<T extends Service>
TgetService(Class<T> serviceClass) Get a service by class type.<T extends Service>
voidregisterServiceProvider(ServiceProvider<T> serviceProvider) Register a service provider with the service registry.default <T extends Service>
TtryGetService(Class<T> serviceClass) Safely get a service if it exists, or null if it does not.
-
Method Details
-
getService
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
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
nullif the service was not found
-
registerServiceProvider
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 benull
-
close
void close()Closes the service registry.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-