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 TypeMethodDescriptionvoidAdds a bean to the registry.voidAdds a bean to the registry, resolving the class type from thebeaninstance.<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> TlookupByName(String name, Class<T> type) Lookup a specific bean by its name and type.voidRemove 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
nullif 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 benulltype- the bean class type, should not benullbean- the bean instance, should not benull
-
add
Adds a bean to the registry, resolving the class type from thebeaninstance.- Parameters:
name- the bean name the instance should be registered with, should not benullbean- the bean instance, should not benull
-
remove
Remove a bean from the registry by name.- Parameters:
name- the bean name
-