public class PollingMonitoredValue<T> extends SettableValue<T>
Supplier.| Modifier and Type | Class and Description |
|---|---|
private class |
PollingMonitoredValue.PollerTask |
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOG |
private static int |
MIN_UPDATE_INTERVAL
The minimum time in ms that may be specified as an updateInterval.
|
private com.google.common.base.Supplier<T> |
poller |
private static java.util.Timer |
POLLING_TIMER |
private static java.util.List<java.util.TimerTask> |
SCHEDULED_TASKS
All timer tasks that have been scheduled in PollingMonitoredValues;
useful only for testing.
|
private static Scheduler |
SHARED_TIMER_SCHEDULER |
value| Constructor and Description |
|---|
PollingMonitoredValue(java.lang.String name,
java.lang.String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics)
Creates a new
PollingMonitoredValue with the specified polling
interval. |
PollingMonitoredValue(java.lang.String name,
java.lang.String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics,
javax.measure.Unit<?> unit)
Creates a new
PollingMonitoredValue with the specified polling
interval. |
PollingMonitoredValue(java.lang.String name,
java.lang.String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics,
javax.measure.Unit<?> unit,
Scheduler scheduler)
Creates a new
PollingMonitoredValue with the specified polling
interval. |
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
poll(java.lang.String name,
java.lang.String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics,
javax.measure.Unit<?> unit)
Convenient factory method to create pollers you don't care about keeping
– that is, pollers which should be registered and start updating their
value, but which you don't need to hold a reference to (because you will
presumably just be modifying the polled source).
|
(package private) static void |
runAllTasks() |
get, setattachMonitor, getDescription, getName, getSemantics, getType, getUnit, isAttached, logValue, notifyMonitors, registerSelf, removeMonitorprivate static final org.slf4j.Logger LOG
private static final int MIN_UPDATE_INTERVAL
private static final java.util.Timer POLLING_TIMER
private static Scheduler SHARED_TIMER_SCHEDULER
private final com.google.common.base.Supplier<T> poller
private static final java.util.List<java.util.TimerTask> SCHEDULED_TASKS
public PollingMonitoredValue(java.lang.String name,
java.lang.String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics)
PollingMonitoredValue with the specified polling
interval.updateInterval - how frequently the Poller should be checked for updates (may
not be less than MIN_UPDATE_INTERVALpublic PollingMonitoredValue(java.lang.String name,
java.lang.String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics,
javax.measure.Unit<?> unit)
PollingMonitoredValue with the specified polling
interval.updateInterval - how frequently the Poller should be checked for updates (may
not be less than MIN_UPDATE_INTERVALpublic PollingMonitoredValue(java.lang.String name,
java.lang.String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics,
javax.measure.Unit<?> unit,
Scheduler scheduler)
PollingMonitoredValue with the specified polling
interval.updateInterval - how frequently the Poller should be checked for updates (may
not be less than MIN_UPDATE_INTERVALstatic void runAllTasks()
public static <T> void poll(java.lang.String name,
java.lang.String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics,
javax.measure.Unit<?> unit)