public class MonitoredConstant<T> extends AbstractMonitorable<T>
Monitorable
for
simple values that are rarely (read: never) updated, once initialised.
This class should be used as for values which rarely change, such as the number of installed CPUs or the application version number.
A setter exists for those cases where the value is not known until after creation (pre-registration of the Monitorable is required, but the value is not known at creation time), but this should not be called as a matter of course.
Modifier and Type | Field and Description |
---|---|
protected T |
value |
LOG
Constructor and Description |
---|
MonitoredConstant(String name,
String description,
MonitorableRegistry registry,
T initialValue) |
MonitoredConstant(String name,
String description,
MonitorableRegistry registry,
T initialValue,
javax.measure.Unit<?> unit) |
MonitoredConstant(String name,
String description,
T initialValue) |
MonitoredConstant(String name,
String description,
T initialValue,
javax.measure.Unit<?> unit) |
Modifier and Type | Method and Description |
---|---|
T |
get()
This method should never block and must return as quickly as possible.
|
void |
set(T newValue)
Sets the current value of this Monitorable.
|
attachMonitor, getDescription, getName, getSemantics, getType, getUnit, logValue, notifyMonitors, registerSelf, removeMonitor
public MonitoredConstant(String name, String description, T initialValue, javax.measure.Unit<?> unit)
public MonitoredConstant(String name, String description, MonitorableRegistry registry, T initialValue)
public MonitoredConstant(String name, String description, MonitorableRegistry registry, T initialValue, javax.measure.Unit<?> unit)
public T get()
Monitorable
public void set(T newValue)
Copyright © 2009–2018 Performance Co-Pilot. All rights reserved.