Package io.debezium.service
Class DefaultServiceRegistry
java.lang.Object
io.debezium.service.DefaultServiceRegistry
- All Implemented Interfaces:
ServiceRegistry
,Closeable
,AutoCloseable
@Incubating
@ThreadSafe
public class DefaultServiceRegistry
extends Object
implements ServiceRegistry
Default implementation of the
ServiceRegistry
.- Author:
- Chris Cranford
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Configuration
private final ConcurrentMap<Class<?>,
Service> private static final org.slf4j.Logger
private final List<ServiceRegistration<?>>
private final ConcurrentMap<Class<?>,
ServiceRegistration<?>> -
Constructor Summary
ConstructorDescriptionDefaultServiceRegistry
(Configuration configuration, BeanRegistry beanRegistry) Creates the default service registry, which registers theBeanRegistry
as a service. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the service registry.private <T extends Service>
voidconfigureService
(ServiceRegistration<T> registration) private <T extends Service>
TcreateService
(ServiceRegistration<T> registration) private <T extends Service>
TcreateService
(ServiceProvider<T> serviceProvider) private <T extends Service>
voiddoInjection
(T service, Method method, InjectService injectService) private <T extends Service>
voiddoInjections
(T service) private <T extends Service>
voiddoMultiPhaseInitialization
(ServiceRegistration<T> registration) private <T extends Service>
ServiceRegistration<T>findRegistration
(Class<T> serviceClass) <T extends Service>
TgetService
(Class<T> serviceClass) Get a service by class type.private <T extends Service>
TinitializeService
(ServiceRegistration<T> registration) private <T extends Service>
voidinjectDependencies
(ServiceRegistration<T> registration) private <T extends Service>
voidregisterService
(ServiceRegistration<T> registration, T service) <T extends Service>
voidregisterServiceProvider
(ServiceProvider<T> serviceProvider) Register a service provider with the service registry.private <T extends Service>
voidstartService
(ServiceRegistration<T> registration) private <T extends Service>
voidstopService
(ServiceRegistration<T> registration) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.debezium.service.spi.ServiceRegistry
tryGetService
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
serviceRegistrations
-
initializedServices
-
registrations
-
configuration
-
-
Constructor Details
-
DefaultServiceRegistry
Creates the default service registry, which registers theBeanRegistry
as a service.- Parameters:
configuration
- the user configuration, should not benull
beanRegistry
- the bean registry instance, should not benull
-
-
Method Details
-
getService
Description copied from interface:ServiceRegistry
Get a service by class type.- Specified by:
getService
in interfaceServiceRegistry
- Type Parameters:
T
- the service class type- Parameters:
serviceClass
- the service class- Returns:
- the requested service
-
close
public void close()Description copied from interface:ServiceRegistry
Closes the service registry.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceServiceRegistry
-
registerServiceProvider
Description copied from interface:ServiceRegistry
Register a service provider with the service registry. A provider allows the construction and resolution of services lazily upon first request and use.- Specified by:
registerServiceProvider
in interfaceServiceRegistry
- Type Parameters:
T
- the service type- Parameters:
serviceProvider
- the service provider, should not benull
-
createService
-
configureService
-
injectDependencies
-
startService
-
stopService
private <T extends Service> void stopService(ServiceRegistration<T> registration) throws IOException - Throws:
IOException
-
registerService
-
doInjections
-
doInjection
-
findRegistration
-
initializeService
-
doMultiPhaseInitialization
-
createService
-