JMX Notification Classes and Interfaces
In this section, we will look at the classes that compliant implementations of JMX must supply. We will also look at examples of how to use each of these classes to create, filter, broadcast, and receive JMX notifications.
Notification
This class contains the information conveyed by a JMX notification and has the following fields:
A notification type—a string that uniquely identifies the type of the notification
A reference to the
ObjectNameof the source of the notificationA sequence number—an integer that conveys information between the broadcaster and the listener regarding the occurrence of a notification
A time stamp (optional) produced by the broadcaster to convey the date and time at which the notification was created
A message (optional)—a string containing text that provides additional explanation about the notification
User-defined data (optional)—an
Objectreference to an object that is used to convey richer information between broadcaster and listener than is possible through any of the other fields
Instances of this class are normally created by the notification broadcaster, which uses the following four constructors to do so:
public Notification(String type, Object source, long sequenceNumber) { // . . . } public Notification(String type, Object source, long sequenceNumber, String message) { // . . . } public Notification(String type, Object source, long sequenceNumber, long timeStamp) { // . . . } public Notification(String ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access