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 Details

  • 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

      @NonnullAfterInit public ReloadableService<T> getService()
      Get the service to report on.
      Returns:
      service to report on
    • setService

      public void setService(@Nonnull ReloadableService<T> svc)
      Set the service to report on.
      Parameters:
      svc - service instance
    • doInitialize

      protected void doInitialize() throws ComponentInitializationException
      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:
      doInitialize in class AbstractInitializableComponent
      Throws:
      ComponentInitializationException - thrown if there is a problem initializing the component
    • getMetrics

      public Map<String,com.codahale.metrics.Metric> getMetrics()
      Specified by:
      getMetrics in interface com.codahale.metrics.MetricSet
    • matches

      public boolean matches(String name, com.codahale.metrics.Metric metric)
      Specified by:
      matches in interface com.codahale.metrics.MetricFilter
    • getMetricMap

      @Nonnull @Live protected Map<String,com.codahale.metrics.Metric> getMetricMap()
      Get the underlying map of metrics.
      Returns:
      map of metrics
    • getLogPrefix

      @Nonnull @NotEmpty protected final String getLogPrefix()
      Get the log prefix.
      Returns:
      the log prefix (usually the metric name).