public class SimpleMeasureManager extends Object implements MeasureManager
SimpleMeasureManager provides a basic implementation to manage a
collection of Measures. One can use the setXxxMeasure() methods to
configure the MeasureManager with the finest granularity, or exploit
the centralized setMeasure(Object, Measure) to register a
Measure depending on the interfaces it implements, or even use the
massive setAllMeasures(Map) to register a set of Measures at
once. The corresponding removeXxx methods are also available for each case.
However, the only way to access a Measure is through the finest
granularity with getPullMeasure(Object) and
getPushMeasure(Object).| Constructor and Description |
|---|
SimpleMeasureManager() |
| Modifier and Type | Method and Description |
|---|---|
Collection<Object> |
getMeasureKeys()
Provides the keys of all the
Measures which are supported by this
SimpleMeasureManager. |
<T> PullMeasure<T> |
getPullMeasure(Object key) |
<T> PushMeasure<T> |
getPushMeasure(Object key) |
void |
removeAllMeasures(Iterable<? extends Object> keys)
Massive equivalent to
removeMeasure(Object). |
void |
removeMeasure(Object key)
This method removes an entire
Measure, meaning that if both a
PullMeasure and a PushMeasure are registered for this
key, then both are removed. |
void |
removePullMeasure(Object key) |
void |
removePushMeasure(Object key) |
void |
setAllMeasures(Map<? extends Object,? extends Measure<?>> measures)
Massive equivalent of
setMeasure(Object, Measure). |
void |
setMeasure(Object key,
Measure<?> measure)
This method call
setPullMeasure(Object, PullMeasure) or
setPushMeasure(Object, PushMeasure) depending on the interfaces
implemented by the Measure given in argument. |
void |
setPullMeasure(Object key,
PullMeasure<?> measure) |
void |
setPushMeasure(Object key,
PushMeasure<?> measure) |
public Collection<Object> getMeasureKeys()
Measures which are supported by this
SimpleMeasureManager. If a key is provided, then at least one
version is available through getPullMeasure(Object) or
getPushMeasure(Object).getMeasureKeys in interface MeasureManagerMeasurespublic void setPullMeasure(Object key, PullMeasure<?> measure)
key - the key of the Measuremeasure - the PullMeasure to registerpublic <T> PullMeasure<T> getPullMeasure(Object key)
getPullMeasure in interface MeasureManagerkey - the key of the MeasurePullMeasure identified by this keypublic void removePullMeasure(Object key)
key - the key of the PullMeasure to removepublic void setPushMeasure(Object key, PushMeasure<?> measure)
key - the key of the Measuremeasure - the PushMeasure to registerpublic <T> PushMeasure<T> getPushMeasure(Object key)
getPushMeasure in interface MeasureManagerkey - the key of the MeasurePushMeasure identified by this keypublic void removePushMeasure(Object key)
key - the key of the PushMeasure to removepublic void setMeasure(Object key, Measure<?> measure)
setPullMeasure(Object, PullMeasure) or
setPushMeasure(Object, PushMeasure) depending on the interfaces
implemented by the Measure given in argument. If both interfaces
are implemented, both methods are called, allowing to register all the
aspects of the Measure in one call.public void removeMeasure(Object key)
Measure, meaning that if both a
PullMeasure and a PushMeasure are registered for this
key, then both are removed.key - the key of the Measure to removepublic void setAllMeasures(Map<? extends Object,? extends Measure<?>> measures)
setMeasure(Object, Measure).measures - the Measures to register with their corresponding keyspublic void removeAllMeasures(Iterable<? extends Object> keys)
removeMeasure(Object).keys - the keys of the Measures to removeCopyright © 2015. All rights reserved.