Package io.github.resilience4j.core
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addConfiguration(java.lang.String configName, C configuration)
Adds a configuration to the registryjava.util.Optional<E>
find(java.lang.String name)
Find a named entry in the Registryjava.util.Optional<C>
getConfiguration(java.lang.String configName)
Get a configuration by nameC
getDefaultConfig()
Get the default configurationRegistry.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 Registryjava.util.Optional<E>
replace(java.lang.String name, E newEntry)
Replace an existing entry in the Registry by a new one.
-
-
-
Method Detail
-
addConfiguration
void addConfiguration(java.lang.String configName, C configuration)
Adds a configuration to the registry- Parameters:
configName
- the configuration nameconfiguration
- 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 namenewEntry
- 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
-
-