User: ejort
Date: 02/02/08 13:17:54
Modified: src/main/javax/management NotificationFilterSupport.java
Log:
Working version of relation classes - still RelationSupport and RelationService to
test
Revision Changes Path
1.3 +14 -3 jmx/src/main/javax/management/NotificationFilterSupport.java
Index: NotificationFilterSupport.java
===================================================================
RCS file:
/cvsroot/jboss/jmx/src/main/javax/management/NotificationFilterSupport.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NotificationFilterSupport.java 26 Jan 2002 15:13:23 -0000 1.2
+++ NotificationFilterSupport.java 8 Feb 2002 21:17:54 -0000 1.3
@@ -6,16 +6,20 @@
*/
package javax.management;
+import java.util.Enumeration;
import java.util.Vector;
/**
* An implementation of the {@link NotificationFilter} interface.<p>
*
* It filters on the notification type. It Maintains a list of enabled
- * notification types. By default no notifications are enabled.
+ * notification types. By default no notifications are enabled.<p>
+ *
+ * The enabled types are prefixes. That is a notification is enabled if
+ * it starts with an enabled string.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Adrian Brock</a>.
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*
*/
public class NotificationFilterSupport
@@ -104,7 +108,14 @@
if (notification == null)
throw new IllegalArgumentException("null notification");
// Is it enabled?
- return enabled.contains(notification.getType());
+ String notificationType = notification.getType();
+ for (Enumeration e = enabled.elements(); e.hasMoreElements(); )
+ {
+ String type = (String) e.nextElement();
+ if (notificationType.startsWith(type))
+ return true;
+ }
+ return false;
}
// Private -----------------------------------------------------
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development