1 7 package test.compliance.notification.support; 8 9 import java.util.ArrayList; 10 import java.util.HashMap; 11 12 import javax.management.Notification; 13 import javax.management.NotificationListener; 14 15 20 public class Listener 21 implements NotificationListener 22 { 23 25 28 public HashMap notifications = new HashMap(); 29 30 32 35 public Listener() 36 { 37 } 38 39 41 44 public void handleNotification(Notification notification, Object handback) 45 { 46 synchronized(notifications) 47 { 48 ArrayList received = (ArrayList) notifications.get(handback); 49 if (received == null) 50 { 51 received = new ArrayList(); 52 notifications.put(handback, received); 53 } 54 received.add(notification); 55 } 56 } 57 } 58 | Popular Tags |