K - The key typeV - The value typepublic class Monitor<K,V extends Comparable<V>> extends SynchronousProducer<V> implements IMonitor<V>
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(org.symphonyoss.s2.fugue.pipeline.IConsumer<V> listener,
org.symphonyoss.s2.fugue.core.trace.ITraceContext trace)
Add the given listener and optionally call back immediately with the
current value.
|
V |
getValue() |
Monitor<K,V> |
setValue(V value,
org.symphonyoss.s2.fugue.core.trace.ITraceContext trace) |
Monitor<K,V> |
setValueIfGreater(V value,
org.symphonyoss.s2.fugue.core.trace.ITraceContext trace) |
addListener, notify, produce, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListener, removeListenerpublic Monitor(V value)
public Monitor<K,V> setValueIfGreater(V value, org.symphonyoss.s2.fugue.core.trace.ITraceContext trace)
setValueIfGreater in interface IMonitor<V extends Comparable<V>>public Monitor<K,V> setValue(V value, org.symphonyoss.s2.fugue.core.trace.ITraceContext trace)
setValue in interface IMonitor<V extends Comparable<V>>public void addListener(org.symphonyoss.s2.fugue.pipeline.IConsumer<V> listener, org.symphonyoss.s2.fugue.core.trace.ITraceContext trace)
IMonitoraddListener in interface IMonitor<V extends Comparable<V>>listener - A listener which will be called whenever the value
of this monitor changes.trace - If non-null then call the listener with the current value and the given trace context.Copyright © 2018 Symphony Software Foundation. All rights reserved.