| 1 27 28 package com.adventnet.jmx; 29 30 import java.util.ArrayList ; 31 import java.util.Hashtable ; 32 import java.util.Vector ; 33 import javax.management.monitor.Monitor ; 34 35 public class NotificationThread implements Runnable  36 { 37 public Vector notifList = null; 38 public Hashtable info = null; 39 40 public NotificationThread(Vector notifList, Hashtable info) 41 { 42 this.notifList = notifList; 43 this.info = info; 44 } 45 46 public void run() 47 { 48 try{ 49 if(notifList.size() == 0) 50 Thread.sleep(100); 51 else 52 { 53 NotificationHandler hdlr = (NotificationHandler)notifList.elementAt(0); 54 55 56 if( (hdlr.nf == null) || hdlr.nf.isNotificationEnabled(hdlr.notif) ) 57 { 58 hdlr.nl.handleNotification(hdlr.notif, hdlr.handback); 59 60 String name = hdlr.notif.getClass().getName(); 61 ArrayList alist = (ArrayList )info.get(name); 62 63 if(alist == null) 64 { 65 alist = new ArrayList (); 66 alist.add(hdlr.notif.getType()); 67 68 info.put(name, alist); 69 } 70 else 71 alist.add(hdlr.notif.getType()); 72 } 73 notifList.removeElementAt(0); 74 } 75 } 76 catch(Exception e) 77 { 78 } 80 81 this.notifList = null; 82 this.info = null; 83 } 84 } 85 | Popular Tags |