Package io.debezium.bean
Class DefaultBeanRegistry
java.lang.Object
io.debezium.bean.DefaultBeanRegistry
- All Implemented Interfaces:
BeanRegistry
,Service
The default
BeanRegistry
that supports looking up beans.- Author:
- Chris Cranford
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a bean to the registry.void
Adds a bean to the registry, resolving the class type from thebean
instance.<T> Set<T>
findByType
(Class<T> type) Finds all beans that are registered by the specified type.findByTypeWithName
(Class<T> type) Finds all beans that are registered with the specified type.private <T> Object
findMapValueByType
(Map<Class<?>, Object> map, Class<T> type) private <T> Object
getMapValueWithFallbackTypeLookup
(Map<Class<?>, Object> map, Class<T> type) <T> T
lookupByName
(String name, Class<T> type) Lookup a specific bean by its name and type.void
Remove a bean from the registry by name.
-
Field Details
-
registry
-
-
Constructor Details
-
DefaultBeanRegistry
public DefaultBeanRegistry()
-
-
Method Details
-
findByType
Description copied from interface:BeanRegistry
Finds all beans that are registered by the specified type.- Specified by:
findByType
in interfaceBeanRegistry
- Parameters:
type
- the class type to lookup- Returns:
- set of all beans found, may be empty, never
null
-
findByTypeWithName
Description copied from interface:BeanRegistry
Finds all beans that are registered with the specified type.- Specified by:
findByTypeWithName
in interfaceBeanRegistry
- Parameters:
type
- the class type to lookup- Returns:
- map of bean instances with their mapping register names, may be empty, never
null
-
lookupByName
Description copied from interface:BeanRegistry
Lookup a specific bean by its name and type.- Specified by:
lookupByName
in interfaceBeanRegistry
- Parameters:
name
- the bean name to findtype
- the bean type to find- Returns:
- the bean or
null
if the bean could not be found
-
add
Description copied from interface:BeanRegistry
Adds a bean to the registry.- Specified by:
add
in interfaceBeanRegistry
- Parameters:
name
- the bean name the instance should be registered with, should not benull
type
- the bean class type, should not benull
bean
- the bean instance, should not benull
-
add
Description copied from interface:BeanRegistry
Adds a bean to the registry, resolving the class type from thebean
instance.- Specified by:
add
in interfaceBeanRegistry
- Parameters:
name
- the bean name the instance should be registered with, should not benull
bean
- the bean instance, should not benull
-
remove
Description copied from interface:BeanRegistry
Remove a bean from the registry by name.- Specified by:
remove
in interfaceBeanRegistry
- Parameters:
name
- the bean name
-
findMapValueByType
-
getMapValueWithFallbackTypeLookup
-