org.apache.commons.monitoring.impl.monitors
Class CreateValuesOnDemandMonitor
java.lang.Object
org.apache.commons.monitoring.impl.monitors.AbstractMonitor
org.apache.commons.monitoring.impl.monitors.ObservableMonitor
org.apache.commons.monitoring.impl.monitors.CreateValuesOnDemandMonitor
- All Implemented Interfaces:
- Monitor, Monitor.Observable
- Direct Known Subclasses:
- CompositeValuesMonitor
public class CreateValuesOnDemandMonitor
- extends ObservableMonitor
implementation of the Monitor interface that creates StatValues on
demand. The application can request for Counters/Gauges without having to
handle instantiation of monitors with all required StatValues pre-registered.
- Author:
- Nicolas De Loof
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CreateValuesOnDemandMonitor
public CreateValuesOnDemandMonitor(Monitor.Key key)
getCounter
public Counter getCounter(Role<Counter> role)
- Retrieve a Counter or create a new one for the role
- Specified by:
getCounter in interface Monitor- Overrides:
getCounter in class AbstractMonitor
- Parameters:
role - the Counter role in the monitor
- Returns:
- the Counter
newCounterInstance
protected Counter newCounterInstance(Role<Counter> role)
- Create a new Counter instance
getGauge
public Gauge getGauge(Role<Gauge> role)
- Retrieve a Gauge or create a new one for the role
- Specified by:
getGauge in interface Monitor- Overrides:
getGauge in class AbstractMonitor
- Parameters:
role - the gauge role in the monitor
- Returns:
- the Gauge
newGaugeInstance
protected Gauge newGaugeInstance(Role<Gauge> role)
- Create a new Gauge instance
Copyright © 2008 The Apache Software Foundation. All Rights Reserved.