Interface MonitoredAttribute
- All Known Implementing Classes:
LongMonitoredAttributeBase,MonitoredAttributeBase,StatisticMonitoredAttribute,StringMonitoredAttributeBase
- Author:
- Hemanth Puttaswamy
Monitored Attribute is the interface to represent a Monitorable Attribute. Using this interface, one can get the value of the attribute and set the value if it is a writeable attribute.
-
Method Summary
Modifier and TypeMethodDescriptionvoidIf this attribute needs to be cleared, the user needs to implement this method to reset the state to initial state.Gets the Monitored Attribute Info for the attribute.getName()Gets the name of the Monitored Attribute.getValue()Gets the value of the Monitored Attribute.voidSets the value for the Monitored Attribute if isWritable() is false, the method will throw ILLEGAL Operation exception.
-
Method Details
-
getAttributeInfo
MonitoredAttributeInfo getAttributeInfo()Gets the Monitored Attribute Info for the attribute.
- Parameters:
monitoredAttributeInfo- for this Monitored Attribute.
-
setValue
Sets the value for the Monitored Attribute if isWritable() is false, the method will throw ILLEGAL Operation exception. Also, the type of 'value' should be same as specified in the MonitoredAttributeInfo for a particular instance.
- Parameters:
value- should be any one of the Basic Java Type Objects which are Long, Double, Float, String, Integer, Short, Character, Byte.
-
getValue
Object getValue()Gets the value of the Monitored Attribute. The value can be obtained from different parts of the module. User may choose to delegate the call to getValue() to other variables. NOTE: It is important to make sure that the type of Object returned in getvalue is same as the one specified in MonitoredAttributeInfo for this attribute.
- Parameters:
value- is the current value for this MonitoredAttribute
-
getName
String getName()Gets the name of the Monitored Attribute.
- Parameters:
name- of this Attribute
-
clearState
void clearState()If this attribute needs to be cleared, the user needs to implement this method to reset the state to initial state. If the Monitored Attribute doesn't change like for example (ConnectionManager High Water Mark), then clearState() is a No Op.
-