Interface ObservationHandlerGroup
- All Superinterfaces:
Comparable<ObservationHandlerGroup>
Group of
ObservationHandlers that can be registered
together. The first group claiming membership of a handler is responsible for
registering it. Groups are Comparable so that they can be ordered against each
other.- Since:
- 4.0.0
- Author:
- Phillip Webb
-
Method Summary
Modifier and TypeMethodDescriptiondefault intcompareTo(ObservationHandlerGroup other) Class<?> Return the primary type of handler that this group accepts.default booleanisMember(io.micrometer.observation.ObservationHandler<?> handler) Return if the given handler is a member of this group.static <H extends io.micrometer.observation.ObservationHandler<?>>
ObservationHandlerGroupStatic factory method to create anObservationHandlerGroupwith members of the given handler type.default voidregisterMembers(io.micrometer.observation.ObservationRegistry.ObservationConfig config, List<io.micrometer.observation.ObservationHandler<?>> members) Register group members against the givenObservationRegistry.ObservationConfig.
-
Method Details
-
isMember
default boolean isMember(io.micrometer.observation.ObservationHandler<?> handler) Return if the given handler is a member of this group.- Parameters:
handler- the handler to check- Returns:
- if the handler is a member
-
registerMembers
default void registerMembers(io.micrometer.observation.ObservationRegistry.ObservationConfig config, List<io.micrometer.observation.ObservationHandler<?>> members) Register group members against the givenObservationRegistry.ObservationConfig.- Parameters:
config- the config used to register membersmembers- the group members to register
-
compareTo
- Specified by:
compareToin interfaceComparable<ObservationHandlerGroup>
-
handlerType
Class<?> handlerType()Return the primary type of handler that this group accepts.- Returns:
- the accepted handler type
-
of
static <H extends io.micrometer.observation.ObservationHandler<?>> ObservationHandlerGroup of(Class<H> handlerType) Static factory method to create anObservationHandlerGroupwith members of the given handler type.- Type Parameters:
H- the handler type- Parameters:
handlerType- the handler type- Returns:
- a new
ObservationHandlerGroup
-