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

Fields
Modifier and Type
Field
Description
`private Map<String,com.codahale.metrics.Metric>`
`gauges`
The map of gauges.
`private final String`
`metricPrefix`
The metric Prefix.
`private ReloadableService<T>`
`service`
The service to report on.

### Fields inherited from interface com.codahale.metrics.MetricFilter

`ALL`

## Constructor Summary

Constructors
Constructor
Description
`ReloadableServiceGaugeSet(String metricName)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
Performs the initialization of the component.
`protected final String`
`getLogPrefix()`
Get the log prefix.
`protected Map<String,com.codahale.metrics.Metric>`
`getMetricMap()`
Get the underlying map of metrics.
`Map<String,com.codahale.metrics.Metric>`
`getMetrics()`
`ReloadableService<T>`
`getService()`
Get the service to report on.
`boolean`
`matches(String name, com.codahale.metrics.Metric metric)`
`void`
`setService(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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### gauges

@Nonnull private Map<String,com.codahale.metrics.Metric> gauges
The map of gauges.

### service

@NonnullAfterInit private ReloadableService<T> service
The service to report on.

### metricPrefix

@Nonnull @NotEmpty private final String 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

@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).