
public VersionInfo getSoftwareVersion();
public VersionInfo getSoftwareVersion() {
return BankProperties.getSoftwareVersion();
}
<version-configuration-group name="SoftwareVersion"> <description ID="Software version">Software Version</description> <data-collection> <polled-by-monitor period="1" unit="MINUTE"/> </data-collection> </version-configuration-group>
<version-monitor name="Software version" configuration-group="SoftwareVersion"> <monitored-resource name="BankMBean" type="APPLICATION"/> <version-attribute-mapping> <version-attribute> <observed-resource-attribute name="SoftwareVersion"/> </version-attribute> </version-attribute-mapping> </version-monitor>
The monitoring framework expects a VersionInfo value for Version monitors, that is why the return value of the getSoftwareVersion() method is VersionInfo . This method is declared in the BankMBean interface and is implemented in the class Bank . In the monitor-semantics part of the monitor-configuration.xml a version-configuration-group is declared with name SoftwareVersion, which is used for creating the node in the monitor tree (the monitor-tree part in the XML).
The Software Version monitor appears in the monitoring tree under Applications → Bank Information → General Information.