Package io.debezium.bean.spi
Interface BeanRegistry
- All Superinterfaces:
Service
- All Known Implementing Classes:
DefaultBeanRegistry
Represents a bean registry used to lookup components by name and type.
The
BeanRegistry
extends the Service
contract, allowing it to be exposed
via the service registry to any service easily.- Author:
- Chris Cranford
-
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.<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.
-
Method Details
-
findByType
Finds all beans that are registered by the specified type.- Parameters:
type
- the class type to lookup- Returns:
- set of all beans found, may be empty, never
null
-
findByTypeWithName
Finds all beans that are registered with the specified type.- Parameters:
type
- the class type to lookup- Returns:
- map of bean instances with their mapping register names, may be empty, never
null
-
lookupByName
Lookup a specific bean by its name and type.- 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
Adds a bean to the registry.- 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
Adds a bean to the registry, resolving the class type from thebean
instance.- Parameters:
name
- the bean name the instance should be registered with, should not benull
bean
- the bean instance, should not benull
-
remove
Remove a bean from the registry by name.- Parameters:
name
- the bean name
-