Package net.shibboleth.shared.service
Class ReloadableServiceGaugeSet<T>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.service.ReloadableServiceGaugeSet<T>
- Type Parameters:
T- Type of service we are monitoring
- All Implemented Interfaces:
com.codahale.metrics.Metric,com.codahale.metrics.MetricFilter,com.codahale.metrics.MetricSet,Component,DestructableComponent,InitializableComponent
public class ReloadableServiceGaugeSet<T>
extends AbstractInitializableComponent
implements com.codahale.metrics.MetricSet, com.codahale.metrics.MetricFilter
A set of gauges for a reloadable service.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe map of gauges.private final StringThe metric Prefix.private ReloadableService<T>The service to report on.Fields inherited from interface com.codahale.metrics.MetricFilter
ALL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPerforms the initialization of the component.protected final StringGet the log prefix.Get the underlying map of metrics.Get the service to report on.booleanvoidsetService(ReloadableService<T> svc) Set the service to report on.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
gauges
The map of gauges. -
service
The service to report on. -
metricPrefix
The metric Prefix.
-
-
Constructor Details
-
ReloadableServiceGaugeSet
public ReloadableServiceGaugeSet(@Nonnull @NotEmpty @ParameterName(name="metricName") String metricName) Constructor.- Parameters:
metricName- name to include in metric names produced by this set
-
-
Method Details
-
getService
Get the service to report on.- Returns:
- service to report on
-
doInitialize
Performs the initialization of the component. This method is executed within the lock on the object being initialized. The default implementation of this method is a no-op.- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException- thrown if there is a problem initializing the component
-
getMetrics
- Specified by:
getMetricsin interfacecom.codahale.metrics.MetricSet
-
matches
- Specified by:
matchesin interfacecom.codahale.metrics.MetricFilter
-
getMetricMap
Get the underlying map of metrics.- Returns:
- map of metrics
-
getLogPrefix
Get the log prefix.- Returns:
- the log prefix (usually the metric name).
-