!--a11y-->
Template Installation 
...
1. BankMBean
public String[] getExceededClientsNames(); |
2. Bank
public String[] getExceededClientsNames() { return transaction.getExceededClientsNames(); } |
This method gives the names of all clients that have exceeded 10,000 EUR.
This is the dynamically supplied information that enables the template to install new monitors of a certain type on the fly. All dynamically installed monitors are grouped under a summary named “List of txs over 10,000 EUR”
3. monitor-configuration.xml
a. monitor-semantics

No entry in the monitor-semantics part is required to install a template.
b. monitor-tree
<summary name="List of txs over 10,000 EUR" configuration-group="ExceededClientsNames"> <object name="%0" configuration-group="Exceeded">
<template-info template-name="ExceededClients"> <polled-by-template period="1" unit="MINUTE"> <generating-resource name="BankMBean" type="APPLICATION"/> <template-attribute-mapping> <observed-resource-attribute name="ExceededClientsNames"/> </template-attribute-mapping> </polled-by-template> </template-info>
<integer-monitor name="Amount" configuration-group="ExceededClientsMoney"> <monitored-resource name="BankMBean" type="APPLICATION"/> <integer-attribute-mapping> <integer-attribute> <invoked-resource-method name="getExceededClientsMoney"> <parameter position="0" type="String" value="%0"/> </invoked-resource-method> </integer-attribute> </integer-attribute-mapping> </integer-monitor>
<long-monitor name="Transaction duration" configuration-group="tsDuration"> <monitored-resource name="BankMBean" type="APPLICATION"/> <long-attribute-mapping> <long-attribute> <invoked-resource-method name="getTransactionDuration"> <parameter position="0" type="String" value="%0"/> </invoked-resource-method> </long-attribute> </long-attribute-mapping> </long-monitor>
</object> |
The important element that actually causes the installation of the template is <template-info>.
In our case, it specifies that on each new entry in the dynamically supplied data, the monitoring framework must install a new subtree of monitors which, as a root, has an object with the name of the respective client and configuration group “Exceeded”. For example, if the resource MBean returns an array containing three elements, say cl1, cl2 and cl3, the template will make sure that three objects named cl1, cl2, and cl3 are built and under each of them there are two monitors – one integer monitor describing the amount of money for the respective client and one long monitor, describing the duration of the transaction.
Representation in the monitoring tree (Visual Administrator):
...
1. Before starting the thread this node is empty – there are no transactions over 10,000 EUR:

2. After starting the threads:

See also:
Installation of Template-Based Monitors
