01: package example;
02:
03: import javax.management.NotificationBroadcasterSupport;
04: import javax.management.Notification;
05:
06: /**
07: * Implements an MBean which sends notifications.
08: */
09: public class Emitter extends NotificationBroadcasterSupport implements
10: EmitterMBean {
11: private long _sequence;
12:
13: /**
14: * Sends a notification.
15: */
16: public void send() {
17: Notification notif;
18:
19: notif = new Notification("example.send", this, _sequence++);
20:
21: sendNotification(notif);
22: }
23: }
|