lumis.portal.monitor
Interface IMonitorContext

Package class diagram package IMonitorContext

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.

Since:
4.1.0
See Also:
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

getAggregationValueMap

Map<String,String> getAggregationValueMap()
Returns a view of aggregation values stored in this monitor context.

There is no garantee whether the returned map will or will not reflect futher changes made in this monitor context.

Returns:
an immutable map where the key is the aggregation type key and the value is its respective value in this monitor context.
Since:
4.1.0

setAggregationValue

void setAggregationValue(String aggregationTypeKey,
                         String value)
Stores an aggregation value in this monitor context. 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);
 }
 

Parameters:
aggregationTypeKey - the aggregation type's key.
value - the value to set for the aggregation type.
Since:
4.1.0

removeAggregationValue

void removeAggregationValue(String aggregationTypeKey)
Removes an aggregation value from the current monitor context.

Parameters:
aggregationTypeKey -
Since:
4.1.0
See Also:
setAggregationValue(String, String)

clear

void clear()
Clears all data stored in the current monitor context and resets it to default state.

Since:
4.1.0

isEnabled

boolean isEnabled()
Returns true if monitoring is enabled in the current monitoring context.

Returns:
true if enabled, false if disabled.
Since:
4.1.0
See Also:
setEnabled(boolean)

setEnabled

void setEnabled(boolean enabled)
Enables or disables the monitoring in the current monitoring context. While disabled, all IMonitor instances returned by IMonitorManager.getMonitor(String, java.util.Map) will be monitor instances that do not collect any measure.

Parameters:
enabled - true to enable or false to disable.
Since:
4.1.0


Lumisportal  4.1.0.071221 - Copyright © 2001-2007, Lumis. All Rights Reserved.