MBean Notifications

The Administration, Local Configuration, Security, and Runtime MBeans allow us to view and modify the configuration and runtime statistics of resources being managed by the MBean Server. Notifications and Monitoring go one step further — they allow you to react to changes in the runtime state of the underlying managed resources. This is critical if you want to build a management application that is able to react and respond to runtime state changes of WebLogic resources and services.

The JMX specification defines a model that allows MBeans to broadcast management events called notifications. You then can create applications that listen for JMX notifications. Your applications may also filter out unwanted notifications. Each WebLogic MBean directly or indirectly extends the javax.management.NotificationBroadcaster interface, thereby allowing you to add or remove notification listeners.

Creating a Notification Listener

A notification listener is a handler that is triggered when the MBean it is registered with sends one or more JMX notifications. A notification listener is an instance of a class that implements the javax.management.NotificationListener interface. For remote applications, the listener object should instead implement the weblogic.management.RemoteNotificationListener interface, which merely extends the previous interface and java.rmi.Remote as well, making the JMX notifications available to external clients via RMI.

The listener interface is simple ...

Get WebLogic: The Definitive Guide 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.