Class AbstractRegistry<E,C>
java.lang.Object
io.github.resilience4j.core.registry.AbstractRegistry<E,C>
- All Implemented Interfaces:
Registry<E,C>
Abstract registry to be shared with all resilience4j registries
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.resilience4j.core.Registry
Registry.EventPublisher<E> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected final ConcurrentMap<String,C> protected static final Stringprotected static final Stringprotected final RegistryStore<E>Global tags which must be added to each instance created by this registry.protected static final Stringprotected static final String -
Constructor Summary
ConstructorsConstructorDescriptionAbstractRegistry(C defaultConfig) AbstractRegistry(C defaultConfig, RegistryEventConsumer<E> registryEventConsumer) AbstractRegistry(C defaultConfig, RegistryEventConsumer<E> registryEventConsumer, Map<String, String> tags) AbstractRegistry(C defaultConfig, List<RegistryEventConsumer<E>> registryEventConsumers) AbstractRegistry(C defaultConfig, List<RegistryEventConsumer<E>> registryEventConsumers, Map<String, String> tags) AbstractRegistry(C defaultConfig, List<RegistryEventConsumer<E>> registryEventConsumers, Map<String, String> tags, RegistryStore<E> registryStore) AbstractRegistry(C defaultConfig, Map<String, String> registryTags) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfiguration(String configName, C configuration) Adds a configuration to the registryprotected EcomputeIfAbsent(String name, Supplier<E> supplier) Find a named entry in the RegistrygetAllTags(Map<String, String> tags) Creates map with all tags (registry and instance).getConfiguration(String configName) Get a configuration by nameGet the default configurationReturns an EventPublisher which can be used to register event consumers.getTags()Remove an entry from the RegistryReplace an existing entry in the Registry by a new one.
-
Field Details
-
DEFAULT_CONFIG
- See Also:
-
CONFIG_MUST_NOT_BE_NULL
- See Also:
-
CONSUMER_MUST_NOT_BE_NULL
- See Also:
-
SUPPLIER_MUST_NOT_BE_NULL
- See Also:
-
TAGS_MUST_NOT_BE_NULL
- See Also:
-
entryMap
-
configurations
-
registryTags
Global tags which must be added to each instance created by this registry.
-
-
Constructor Details
-
AbstractRegistry
-
AbstractRegistry
-
AbstractRegistry
-
AbstractRegistry
-
AbstractRegistry
-
AbstractRegistry
-
AbstractRegistry
public AbstractRegistry(C defaultConfig, List<RegistryEventConsumer<E>> registryEventConsumers, Map<String, String> tags, RegistryStore<E> registryStore)
-
-
Method Details
-
computeIfAbsent
-
find
Description copied from interface:RegistryFind a named entry in the Registry -
remove
Description copied from interface:RegistryRemove an entry from the Registry -
replace
Description copied from interface:RegistryReplace an existing entry in the Registry by a new one. -
addConfiguration
Description copied from interface:RegistryAdds a configuration to the registry- Specified by:
addConfigurationin interfaceRegistry<E,C> - Parameters:
configName- the configuration nameconfiguration- the added configuration
-
getConfiguration
Description copied from interface:RegistryGet a configuration by name- Specified by:
getConfigurationin interfaceRegistry<E,C> - Parameters:
configName- the configuration name- Returns:
- the found configuration if any
-
getDefaultConfig
Description copied from interface:RegistryGet the default configuration- Specified by:
getDefaultConfigin interfaceRegistry<E,C> - Returns:
- the default configuration
-
getTags
-
getEventPublisher
Description copied from interface:RegistryReturns an EventPublisher which can be used to register event consumers.- Specified by:
getEventPublisherin interfaceRegistry<E,C> - Returns:
- an EventPublisher
-
getAllTags
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
-