Class AbstractRegistry<E,C>

java.lang.Object
io.github.resilience4j.core.registry.AbstractRegistry<E,C>
All Implemented Interfaces:
Registry<E,C>

public class AbstractRegistry<E,C> extends Object implements Registry<E,C>
Abstract registry to be shared with all resilience4j registries
  • Field Details

  • Constructor Details

  • Method Details

    • computeIfAbsent

      protected E computeIfAbsent(String name, Supplier<E> supplier)
    • find

      public Optional<E> find(String name)
      Description copied from interface: Registry
      Find a named entry in the Registry
      Specified by:
      find in interface Registry<E,C>
      Parameters:
      name - the name
    • remove

      public Optional<E> remove(String name)
      Description copied from interface: Registry
      Remove an entry from the Registry
      Specified by:
      remove in interface Registry<E,C>
      Parameters:
      name - the name
    • replace

      public Optional<E> replace(String name, E newEntry)
      Description copied from interface: Registry
      Replace an existing entry in the Registry by a new one.
      Specified by:
      replace in interface Registry<E,C>
      Parameters:
      name - the existing name
      newEntry - a new entry
    • addConfiguration

      public void addConfiguration(String configName, C configuration)
      Description copied from interface: Registry
      Adds a configuration to the registry
      Specified by:
      addConfiguration in interface Registry<E,C>
      Parameters:
      configName - the configuration name
      configuration - the added configuration
    • getConfiguration

      public Optional<C> getConfiguration(String configName)
      Description copied from interface: Registry
      Get a configuration by name
      Specified by:
      getConfiguration in interface Registry<E,C>
      Parameters:
      configName - the configuration name
      Returns:
      the found configuration if any
    • removeConfiguration

      public C removeConfiguration(String configName)
      Description copied from interface: Registry
      + * Removes a configuration from the registry + * + * @param configName the configuration name + * @return configuration mapped to the configName. +
      Specified by:
      removeConfiguration in interface Registry<E,C>
    • getDefaultConfig

      public C getDefaultConfig()
      Description copied from interface: Registry
      Get the default configuration
      Specified by:
      getDefaultConfig in interface Registry<E,C>
      Returns:
      the default configuration
    • getTags

      public Map<String,String> getTags()
      Specified by:
      getTags in interface Registry<E,C>
      Returns:
      global configured registry tags
    • getEventPublisher

      public Registry.EventPublisher<E> getEventPublisher()
      Description copied from interface: Registry
      Returns an EventPublisher which can be used to register event consumers.
      Specified by:
      getEventPublisher in interface Registry<E,C>
      Returns:
      an EventPublisher
    • getAllTags

      protected Map<String,String> getAllTags(Map<String,String> tags)
      Creates map with all tags (registry and instance). When tags (keys) of the two collide the tags passed with this method will override the tags of the registry.
      Parameters:
      tags - Tags of the instance.
      Returns:
      Map containing all tags