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 ObjectName of the source of the notification

  • A 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 Object reference 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 ...

Get Java Management Extensions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.