...
1. Use the javax.management.AttributeChangeNotifications.
This method is applicable when you want to send monitoring data actively (that is, you want to send the data only upon a certain event instead of being constantly checked for a new value.)
2. Set the name of the attribute in the constructor of the notification, as specified in the attribute-mapping element from the monitor-configuration.xml.
You have to supply this as a new value.
In the case of the example MBean described in the sample XML code from the previous section, you can emit a notification like this:
AttributeChangeNotification notification = new AttributeChangeNotification(this, 1, System.currentTimeMillis(), "important notification", " BankName ", "java.lang.String", “”, newBankName) |
See also: