Interface Registry<E,​C>

All Known Implementing Classes:
AbstractRegistry

public interface Registry<E,​C>
root resilience4j registry to be used by resilience types registries for common functionality
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Interface Description
    static interface  Registry.EventPublisher<E>
    An EventPublisher can be used to register event consumers.
  • Method Summary

    Modifier and Type Method Description
    void addConfiguration​(java.lang.String configName, C configuration)
    Adds a configuration to the registry
    java.util.Optional<E> find​(java.lang.String name)
    Find a named entry in the Registry
    java.util.Optional<C> getConfiguration​(java.lang.String configName)
    Get a configuration by name
    C getDefaultConfig()
    Get the default configuration
    Registry.EventPublisher<E> getEventPublisher()
    Returns an EventPublisher which can be used to register event consumers.
    io.vavr.collection.Map<java.lang.String,​java.lang.String> getTags()  
    java.util.Optional<E> remove​(java.lang.String name)
    Remove an entry from the Registry
    java.util.Optional<E> replace​(java.lang.String name, E newEntry)
    Replace an existing entry in the Registry by a new one.
  • Method Details

    • addConfiguration

      void addConfiguration​(java.lang.String configName, C configuration)
      Adds a configuration to the registry
      Parameters:
      configName - the configuration name
      configuration - the added configuration
    • find

      java.util.Optional<E> find​(java.lang.String name)
      Find a named entry in the Registry
      Parameters:
      name - the name
    • remove

      java.util.Optional<E> remove​(java.lang.String name)
      Remove an entry from the Registry
      Parameters:
      name - the name
    • replace

      java.util.Optional<E> replace​(java.lang.String name, E newEntry)
      Replace an existing entry in the Registry by a new one.
      Parameters:
      name - the existing name
      newEntry - a new entry
    • getConfiguration

      java.util.Optional<C> getConfiguration​(java.lang.String configName)
      Get a configuration by name
      Parameters:
      configName - the configuration name
      Returns:
      the found configuration if any
    • getDefaultConfig

      C getDefaultConfig()
      Get the default configuration
      Returns:
      the default configuration
    • getTags

      io.vavr.collection.Map<java.lang.String,​java.lang.String> getTags()
      Returns:
      global configured registry tags
    • getEventPublisher

      Registry.EventPublisher<E> getEventPublisher()
      Returns an EventPublisher which can be used to register event consumers.
      Returns:
      an EventPublisher