KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > panoptes > component > jmx > model > NotificationRegistry


1 /*
2  * Created on Aug 25, 2003
3  *
4  */

5 package net.sf.panoptes.component.jmx.model;
6
7 import java.util.Collection JavaDoc;
8 import java.util.Vector JavaDoc;
9
10 import javax.management.Notification JavaDoc;
11
12 /**
13  *
14  *
15  * @author Dag Liodden
16  * @version 0.1
17  */

18 public class NotificationRegistry {
19     
20     
21     private Vector JavaDoc notifications = new Vector JavaDoc();
22     private static NotificationRegistry instance;
23         
24     public static NotificationRegistry getInstance() {
25         if (instance == null) instance = new NotificationRegistry();
26         return instance;
27     }
28     
29     public void addNotification(Notification JavaDoc notification) {
30         notifications.add(notification);
31     }
32     
33     public Collection JavaDoc getNotifications() {
34         return new Vector JavaDoc(notifications);
35         
36     }
37 }
38
Popular Tags