org.objectweb.fractal.jmx.listener
Class BasicListener
java.lang.Object
org.objectweb.fractal.jmx.listener.BasicListener
- All Implemented Interfaces:
- EventListener, NotificationListener
- public class BasicListener
- extends Object
- implements NotificationListener
Provides a simple listener component.
An object of this class can be used to receive notifications sent out by standard monitoring services
(counter, gauge and string) of the JMX specification. All notifications received will be write to user screen.
- Version:
- 0.1
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicListener
public BasicListener()
handleNotification
public void handleNotification(Notification n,
Object handback)
- Invoked when a JMX notification occurs. Currently handles
monitor notifications
sent out by standard monitoring services (counter, gauge and string) of the JMX specification.
This listener will print to user screen the following information (part of the received notification):
- the
Date
on which the Event initially occurred (initialized from the notification timestamp),
- the notification type,
- the monitor source on which the Event initially occurred,
- the observed object of this monitor notification,
- the observed attribute of this monitor notification,
- the threshold/string (depending on the monitor type) that triggered off this monitor notification,
- the derived gauge of this monitor notification.
- Specified by:
handleNotification
in interface NotificationListener
- Parameters:
n
- The notification (should be an instance of MonitorNotification
).handback
- An opaque object, not used by this simple implementation.
- Throws:
ClassCastException
- if the received notification is not instance of MonitorNotification
.