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
FieldsModifier and TypeFieldDescriptionprivate final Configurationprivate final ConcurrentMap<Class<?>,Service> private static final org.slf4j.Loggerprivate final List<ServiceRegistration<?>>private final ConcurrentMap<Class<?>,ServiceRegistration<?>> -
Constructor Summary
ConstructorsConstructorDescriptionDefaultServiceRegistry(Configuration configuration, BeanRegistry beanRegistry) Creates the default service registry, which registers theBeanRegistryas a service. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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, waitMethods 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 theBeanRegistryas a service.- Parameters:
configuration- the user configuration, should not benullbeanRegistry- the bean registry instance, should not benull
-
-
Method Details
-
getService
Description copied from interface:ServiceRegistryGet a service by class type.- Specified by:
getServicein 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:ServiceRegistryCloses the service registry.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceServiceRegistry
-
registerServiceProvider
Description copied from interface:ServiceRegistryRegister a service provider with the service registry. A provider allows the construction and resolution of services lazily upon first request and use.- Specified by:
registerServiceProviderin 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
-