commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-commons/modeler/src/java/org/apache/commons/modeler FixedNotificationFilter.java
Date Thu, 16 Jan 2003 19:25:06 GMT
costin      2003/01/16 11:25:06

  Modified:    modeler/src/java/org/apache/commons/modeler
                        FixedNotificationFilter.java
  Log:
  More cleanup. ( this was cut&paste from the attribute notif filter ).
  
  The purpose of FixedNotificationFilter is to allow the broadcaster to
  do the filtering on registration, knowing that the filter is "fixed",
  i.e. allways filters the same notif types.
  
  Revision  Changes    Path
  1.2       +1 -8      jakarta-commons/modeler/src/java/org/apache/commons/modeler/FixedNotificationFilter.java
  
  Index: FixedNotificationFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/FixedNotificationFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FixedNotificationFilter.java	6 Jan 2003 06:01:03 -0000	1.1
  +++ FixedNotificationFilter.java	16 Jan 2003 19:25:06 -0000	1.2
  @@ -115,7 +115,6 @@
        * <p>Test whether notification enabled for this event.
        * Return true if:</p>
        * <ul>
  -     * <li>This is an attribute change notification</li>
        * <li>Either the set of accepted names is empty (implying that all
        *     attribute names are of interest) or the set of accepted names
        *     includes the name of the attribute in this notification</li>
  @@ -125,17 +124,11 @@
   
           if (notification == null)
               return (false);
  -        if (!(notification instanceof AttributeChangeNotification))
  -            return (false);
  -        AttributeChangeNotification acn =
  -            (AttributeChangeNotification) notification;
  -        if (!AttributeChangeNotification.ATTRIBUTE_CHANGE.equals(acn.getType()))
  -            return (false);
           synchronized (names) {
               if (names.size() < 1)
                   return (true);
               else
  -                return (names.contains(acn.getAttributeName()));
  +                return (names.contains(notification.getType()));
           }
   
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message