Class DefaultBeanRegistry

java.lang.Object
io.debezium.bean.DefaultBeanRegistry
All Implemented Interfaces:
BeanRegistry, Service

@Incubating public class DefaultBeanRegistry extends Object implements BeanRegistry
The default BeanRegistry that supports looking up beans.
Author:
Chris Cranford
  • Field Details

  • Constructor Details

    • DefaultBeanRegistry

      public DefaultBeanRegistry()
  • Method Details

    • findByType

      public <T> Set<T> findByType(Class<T> type)
      Description copied from interface: BeanRegistry
      Finds all beans that are registered by the specified type.
      Specified by:
      findByType in interface BeanRegistry
      Parameters:
      type - the class type to lookup
      Returns:
      set of all beans found, may be empty, never null
    • findByTypeWithName

      public <T> Map<String,T> findByTypeWithName(Class<T> type)
      Description copied from interface: BeanRegistry
      Finds all beans that are registered with the specified type.
      Specified by:
      findByTypeWithName in interface BeanRegistry
      Parameters:
      type - the class type to lookup
      Returns:
      map of bean instances with their mapping register names, may be empty, never null
    • lookupByName

      public <T> T lookupByName(String name, Class<T> type)
      Description copied from interface: BeanRegistry
      Lookup a specific bean by its name and type.
      Specified by:
      lookupByName in interface BeanRegistry
      Parameters:
      name - the bean name to find
      type - the bean type to find
      Returns:
      the bean or null if the bean could not be found
    • add

      public void add(String name, Class<?> type, Object bean)
      Description copied from interface: BeanRegistry
      Adds a bean to the registry.
      Specified by:
      add in interface BeanRegistry
      Parameters:
      name - the bean name the instance should be registered with, should not be null
      type - the bean class type, should not be null
      bean - the bean instance, should not be null
    • add

      public void add(String name, Object bean)
      Description copied from interface: BeanRegistry
      Adds a bean to the registry, resolving the class type from the bean instance.
      Specified by:
      add in interface BeanRegistry
      Parameters:
      name - the bean name the instance should be registered with, should not be null
      bean - the bean instance, should not be null
    • remove

      public void remove(String name)
      Description copied from interface: BeanRegistry
      Remove a bean from the registry by name.
      Specified by:
      remove in interface BeanRegistry
      Parameters:
      name - the bean name
    • findMapValueByType

      private <T> Object findMapValueByType(Map<Class<?>,Object> map, Class<T> type)
    • getMapValueWithFallbackTypeLookup

      private <T> Object getMapValueWithFallbackTypeLookup(Map<Class<?>,Object> map, Class<T> type)