Java Reference
In-Depth Information
DynamicMBean.getMBeanInfo() —If the MBean is a Dynamic MBean, it must
implement the getMBeanInfo() method. The MBeanInfo object returned by
this method can contain an array of MBeanNotificationInfo objects.
NotificationBroadcaster.getNotificationInfo() —When implementing the
notification broadcaster interface, MBeans must implement this method.
This method returns an array of MBeanNotificationInfo objects.
An instance of the MBeanNotificationInfo class contains information about the
notifications that an MBean can emit. Just like the other metadata classes, it
extends the MBeanFeatureInfo class.
An MBeanNotificationInfo object contains three things: the Java class name
of the notification object being described (contained in the name class member
variable), the notification types that can be sent using that class, and a descrip-
tion. The name and description fields are inherited from the MBeanFeatureInfo
class. Each instance of MBeanNotificationInfo describes a specific Java class that
is used as a notification. The class will be either javax.management.Notification
or a subclass.
The class also contains a getNotifTypes() method that returns an array of
String objects whose values are used to describe the types of notifications that
could be sent using a particular notification class.
The type in this case does not refer to a Java class designation, but rather to a
dot-separated String that identifies a notification instance. The identification
String —its notification type—identifies a notification and conveys a sense of its
purpose. For example, for a monitoring application developed by Acme Company,
you might have a notification type like acme.notif.statechange . (Notification
types tend to follow the pattern company.resource.eventname . This is only a sug-
gested format; no rule specifies the exact format for the notification type String .)
6.2.3
The Notification class
JMX provides a standard notification class, javax.management.Notification .
This class extends java.util.EventObject and is used as a super class for other
notification classes.
The Notification class contains six member variables that are all accessi-
ble through getter methods. Table 6.2 describes these class members and
their purposes.
The Notification class has several different constructors, each providing a
different set of initialization arguments for these class members.
Search WWH ::




Custom Search