avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl AbstractRowHolder.java
Date Sun, 11 Nov 2001 10:05:11 GMT
hammant     01/11/11 02:05:11

  Modified:    apps/db/src/java/org/apache/avalon/db/data/impl
                        AbstractRowHolder.java
  Log:
  notify for table row changes
  
  Revision  Changes    Path
  1.5       +40 -1     jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/AbstractRowHolder.java
  
  Index: AbstractRowHolder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/AbstractRowHolder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractRowHolder.java	2001/11/10 09:15:45	1.4
  +++ AbstractRowHolder.java	2001/11/11 10:05:11	1.5
  @@ -25,7 +25,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public abstract class AbstractRowHolder extends AbstractNameable implements RowHolder {
   
  @@ -80,6 +80,45 @@
               if (ref.get() == rowListener) {
                   it.remove();
                   return;
  +            }
  +        }
  +    }
  +
  +    protected void notifyRowListenersAdded(Row[] rows) {
  +        Iterator it = mListeners.iterator();
  +        while (it.hasNext()) {
  +            WeakReference ref = (WeakReference) it.next();
  +            RowListener listener = (RowListener) ref.get();
  +            if (listener == null) {
  +                it.remove();
  +            } else {
  +                listener.rowsAdded(rows);
  +            }
  +        }
  +    }
  +
  +    protected void notifyRowListenersChanged(Row[] rows) {
  +        Iterator it = mListeners.iterator();
  +        while (it.hasNext()) {
  +            WeakReference ref = (WeakReference) it.next();
  +            RowListener listener = (RowListener) ref.get();
  +            if (listener == null) {
  +                it.remove();
  +            } else {
  +                listener.rowsChanged(rows);
  +            }
  +        }
  +    }
  +
  +    protected void notifyRowListenersDeleted(Row[] rows) {
  +        Iterator it = mListeners.iterator();
  +        while (it.hasNext()) {
  +            WeakReference ref = (WeakReference) it.next();
  +            RowListener listener = (RowListener) ref.get();
  +            if (listener == null) {
  +                it.remove();
  +            } else {
  +                listener.rowsDeleted(rows);
               }
           }
       }
  
  
  

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


Mime
View raw message