Class DefaultReactiveHealthContributorRegistry
java.lang.Object
org.springframework.boot.health.registry.DefaultReactiveHealthContributorRegistry
- All Implemented Interfaces:
Iterable<ReactiveHealthContributors.Entry>, ReactiveHealthContributors, ReactiveHealthContributorRegistry
public class DefaultReactiveHealthContributorRegistry
extends Object
implements ReactiveHealthContributorRegistry
Default
ReactiveHealthContributorRegistry implementation.- Since:
- 4.0.0
- Author:
- Phillip Webb
-
Nested Class Summary
Nested classes/interfaces inherited from interface ReactiveHealthContributors
ReactiveHealthContributors.Entry -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new emptyDefaultReactiveHealthContributorRegistryinstance.DefaultReactiveHealthContributorRegistry(@Nullable Collection<? extends HealthContributorNameValidator> nameValidators, @Nullable Consumer<BiConsumer<String, ReactiveHealthContributor>> initialRegistrations) Create a newDefaultReactiveHealthContributorRegistryinstance. -
Method Summary
Modifier and TypeMethodDescription@Nullable ReactiveHealthContributorgetContributor(String name) Return the contributor with the given name.voidregisterContributor(String name, ReactiveHealthContributor contributor) Register a contributor with the givenname.stream()Return a stream of the contributor entries.@Nullable ReactiveHealthContributorunregisterContributor(String name) Unregister a previously registered contributor.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface ReactiveHealthContributors
asHealthContributors, iterator
-
Constructor Details
-
DefaultReactiveHealthContributorRegistry
public DefaultReactiveHealthContributorRegistry()Create a new emptyDefaultReactiveHealthContributorRegistryinstance. -
DefaultReactiveHealthContributorRegistry
public DefaultReactiveHealthContributorRegistry(@Nullable Collection<? extends HealthContributorNameValidator> nameValidators, @Nullable Consumer<BiConsumer<String, ReactiveHealthContributor>> initialRegistrations) Create a newDefaultReactiveHealthContributorRegistryinstance.- Parameters:
nameValidators- the name validators to applyinitialRegistrations- callback to setup any initial registrations
-
-
Method Details
-
getContributor
Description copied from interface:ReactiveHealthContributorsReturn the contributor with the given name.- Specified by:
getContributorin interfaceReactiveHealthContributors- Parameters:
name- the name of the contributor- Returns:
- a contributor instance or
null
-
stream
Description copied from interface:ReactiveHealthContributorsReturn a stream of the contributor entries.- Specified by:
streamin interfaceReactiveHealthContributors- Returns:
- the stream of named contributors
-
registerContributor
Description copied from interface:ReactiveHealthContributorRegistryRegister a contributor with the givenname.- Specified by:
registerContributorin interfaceReactiveHealthContributorRegistry- Parameters:
name- the name of the contributorcontributor- the contributor to register
-
unregisterContributor
Description copied from interface:ReactiveHealthContributorRegistryUnregister a previously registered contributor.- Specified by:
unregisterContributorin interfaceReactiveHealthContributorRegistry- Parameters:
name- the name of the contributor to unregister- Returns:
- the unregistered indicator, or
nullif no indicator was found in the registry for the givenname.
-