Java Reference
In-Depth Information
MBeanServerDelegate . Apart from providing you with some information about the
environment, this MBean serves to send notifications from the MBean server. An
MBeanServer instance creates and registers this MBean in order to delegate the
notification delivery, allowing the MBeanServer to go back to managing MBeans.
The delegate MBean performs the following two notification-related tasks:
Emits an MBeanServerNotification when necessary (as described in the
next section)
Emits notifications that have been captured from other registered MBeans
6.7.1
Notification types sent from the MBean server
The MBean server's purpose is to provide a mechanism for managing MBeans.
When working with an MBean server, you might find it important to know when
new MBeans are registered or existing ones are removed. The MBean server
emits the following notification types for these two events:
jmx.mbean.registered
jmx.mbean.unregistered
The two types correspond to registering and unregistering of MBeans. The impor-
tant question, though, is how to register to receive these notifications. You know
two facts that address this question: the MBean server delegates sending notifi-
cations to the MBeanServerDelegate MBean, and you can register to listen on any
MBean that sends notifications. In order for the delegate MBean to send notifi-
cations, it must be a notification broadcaster. Therefore, just as the previous sec-
tion described, you need to register as a listener with the delegate MBean. In
order to do that, you need its object name. Again, recall from chapter 2 that the
MBeanServerDelegate MBean's ObjectName value is JMImplementation:type=
MBeanServerDelegate .
The notifications emitted by the MBean server are of the class MBeanServer-
Notification . This class extends the Notification class and provides an addi-
tional operation, getObjectName() , which returns the object name of the MBean
that caused the notification to be sent (by being registered or unregistered). The
class also defines two public final static members— REGISTRATION_NOTIFICATION
and UNREGISTRATION_NOTIFICATION —that correspond to the previously men-
tioned types.
In addition, JMX provides a filter for this type of notification. The MBean-
ServerNotificationFilter class extends the NotificationFilterSupport class and
provides methods that allow a listener to filter incoming MBeanServerNotification
Search WWH ::




Custom Search