Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6610917
Votes 0
Synopsis Define a generic NotificationFilter
Category jmx:classes
Reported Against 1.5 , 2.0
Release Fixed 7(b26)
State 10-Fix Delivered, request for enhancement
Priority: 3-Medium
Related Bugs 6301223 , 6577604 , 6602310 , 6611518 , 4718350
Submit Date 28-SEP-2007
Description
The JMX API today defines an interface NotificationFilter and three concrete implementations of it: AttributeChangeNotificationFilter, MBeanServerNotificationFilter, and NotificationFilterSupport.  If your filter case corresponds to one of these you are in luck, but if not then you need to write a custom filter class.  If you're adding the filter remotely, then you need to arrange for this class to be present on both client and server, which is a pain.

What's needed is to provide a more generic filter class that will cover most cases that users need.  It should certainly be able to do everything that the existing classes, plus cover some common cases that they don't.

Some examples:

    *  An AttributeChangeNotification where the attribute name is "SecurityLevel" or "ErrorCount". (This corresponds to AttributeChangeNotificationFilter.)
    * An AttributeChangeNotification where the attribute type is "int".
    * An AttributeChangeNotification where the attribute name is "SecurityLevel" and the new value of the attribute is greater than 3.
    * An MBeanServerNotification where the ObjectName is "a:b=c" or "x:y=z".  (This corresponds to MBeanServerNotificationFilter.)
    * An MBeanServerNotification where the ObjectName matches "mydomain:*". (This is currently not possible with MBeanServerNotificationFilter, which is bug 6577604.)
    * A Notification where the type string is "my.type.one" or "my.type.two". (This corresponds to NotificationFilterSupport.)
Posted Date : 2007-09-28 15:14:46.0
Work Around
N/A
Evaluation
The proposal is to define the new class such that it evaluates a javax.management.QueryExp against the Notification.  Using the query language (see CR 6602310), the cases in the CR description are covered as follows:

    *  An AttributeChangeNotification where the attribute name is "SecurityLevel" or "ErrorCount":
      "instanceof 'javax.management.AttributeChangeNotification' and AttributeName in ('SecurityLevel', 'ErrorCount')".
    * An AttributeChangeNotification where the attribute type is "int":
      "instanceof 'javax.management.AttributeChangeNotification' and AttributeType = 'int'".
    * An AttributeChangeNotification where the attribute name is "SecurityLevel" and the new value of the attribute is greater than 3:
      "instanceof 'javax.management.AttributeChangeNotification' and AttributeName = 'SecurityLevel' and NewValue > 3".
    * An MBeanServerNotification where the ObjectName is "a:b=c" or "x:y=z":
      "instanceof 'javax.management.relation.MBeanServerNotification' and ObjectName.canonicalName in ('a:b=c', 'x:y=z')".
    * An MBeanServerNotification where the ObjectName matches "mydomain:*":
      "instanceof 'javax.management.relation.MBeanServerNotification' and ObjectName.canonicalName like 'mydomain:%'".
    * A Notification where the type string is "my.type.one" or "my.type.two":
      "Type in ('my.type.one', 'my.type.two')".
Posted Date : 2007-09-28 15:14:46.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang