|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMonitorContext
Stores contextual data and configuration for use by the monitoring framework. The state of the monitor context applies to the current thread.
IMonitorManager
Method Summary | |
---|---|
void |
clear()
Clears all data stored in the current monitor context and resets it to default state. |
Map<String,String> |
getAggregationValueMap()
Returns a view of aggregation values stored in this monitor context. |
boolean |
isEnabled()
Returns true if monitoring is enabled in the current monitoring context. |
void |
removeAggregationValue(String aggregationTypeKey)
Removes an aggregation value from the current monitor context. |
void |
setAggregationValue(String aggregationTypeKey,
String value)
Stores an aggregation value in this monitor context. |
void |
setEnabled(boolean enabled)
Enables or disables the monitoring in the current monitoring context. |
Method Detail |
---|
Map<String,String> getAggregationValueMap()
There is no garantee whether the returned map will or will not reflect futher changes made in this monitor context.
void setAggregationValue(String aggregationTypeKey, String value)
removeAggregationValue(String)
should be called
(use a try/finally block to ensure that) to remove the aggregation value
set when it should no longer be applied.
Typical use for setting an aggregation value follows below:
final String aggregationTypeKey = ...; final String aggregationValue = ...; monitorContext.setAggregationValue(aggregationTypeKey, aggregationValue); try { // execution block that will have the set aggregation value as default } finally { monitorContext.removeAggregationValue(aggregationTypeKey); }
aggregationTypeKey
- the aggregation type's key.value
- the value to set for the aggregation type.void removeAggregationValue(String aggregationTypeKey)
aggregationTypeKey
- setAggregationValue(String, String)
void clear()
boolean isEnabled()
setEnabled(boolean)
void setEnabled(boolean enabled)
IMonitor
instances returned by
IMonitorManager.getMonitor(String, java.util.Map)
will
be monitor instances that do not collect any measure.
enabled
- true to enable or false to disable.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |