1 17 18 19 package org.apache.tomcat.util.modeler; 20 21 22 import java.util.HashSet ; 23 24 import javax.management.Notification ; 25 import javax.management.NotificationFilter ; 26 27 28 41 public class FixedNotificationFilter implements NotificationFilter { 42 43 47 private HashSet names = new HashSet (); 48 String namesA[]=null; 49 50 56 public FixedNotificationFilter(String names[]) { 57 super(); 58 } 59 60 65 public String [] getNames() { 66 synchronized (names) { 67 return ((String []) names.toArray(new String [names.size()])); 68 } 69 } 70 71 72 81 public boolean isNotificationEnabled(Notification notification) { 82 83 if (notification == null) 84 return (false); 85 synchronized (names) { 86 if (names.size() < 1) 87 return (true); 88 else 89 return (names.contains(notification.getType())); 90 } 91 92 } 93 94 95 } 96 | Popular Tags |