!--a11y-->
State Monitor - "Bank Rank" 
...
1. BankMBean
public String getBankState(); |
2. Bank
public String getBankState() { return BankProperties.getBankState(); } |
3. monitor-configuration.xml
a. monitor-semantics
<state-configuration-group name="Rank" alert-mode="ALWAYS"> <description ID="Ranking">Ranking of the bank</description> <data-collection> <polled-by-monitor period="1" unit="MINUTE"/> </data-collection> <color-states> <green-states> <state>Big</state> </green-states> <yellow-states> <state>Medium</state> <state>Small</state> </yellow-states> <red-states> <state>Bankrupted</state> </red-states> </color-states> </state-configuration-group> |
b. monitor-tree
<state-monitor name="Bank ranking" configuration-group="Rank"> <monitored-resource name="BankMBean" type="APPLICATION"/> <state-attribute-mapping> <state-attribute> <observed-resource-attribute name="BankState"/> </state-attribute> </state-attribute-mapping> </state-monitor> |
The monitoring framework expects a String value for state monitors, that is why the return value of the getBankState () method is String. This method is declared in the BankMBean interface and it is implemented in the class Bank. In the monitor-semantics part of the monitor-configuration.xml a state-configuration-group is declared with name ‘Rank’, which is used for creating the node in the monitor tree(the monitor-tree part in the XML). The ID in the ‘Bank ranking’ description is the name of the monitor shown in the tree. Also, in monitor-semantics (under ‘color-states’) the colors of the value are declared: green-state for Big, yellow-state for Medium, and Small and red-state for Bankrupted.
Representation in the monitoring tree (Visual Administrator):

The next step is to create a table monitor named “Counter Desks”
