avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craft...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/store/src/java/org/apache/excalibur/store/impl AbstractFilesystemStore.java MRUMemoryStore.java MemoryStore.java
Date Wed, 14 Aug 2002 15:33:54 GMT
crafterm    2002/08/14 08:33:53

  Modified:    store/src/java/org/apache/excalibur/store Store.java
               store/src/java/org/apache/excalibur/store/impl
                        AbstractFilesystemStore.java MRUMemoryStore.java
                        MemoryStore.java
  Log:
  Applied patch implementing Store.clear() methods from
  Michael Melhem (Michael.Melhem@managesoft.com)
  
  Revision  Changes    Path
  1.4       +6 -1      jakarta-avalon-excalibur/store/src/java/org/apache/excalibur/store/Store.java
  
  Index: Store.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/store/src/java/org/apache/excalibur/store/Store.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Store.java	14 Jul 2002 01:28:01 -0000	1.3
  +++ Store.java	14 Aug 2002 15:33:53 -0000	1.4
  @@ -65,6 +65,11 @@
       void remove( Object key );
   
       /**
  +     * Clear the Store of all data it holds 
  +     */
  +    void clear();
  +
  +    /**
        * Indicates if the given key is associated to a contained object.
        */
       boolean containsKey( Object key );
  
  
  
  1.4       +15 -1     jakarta-avalon-excalibur/store/src/java/org/apache/excalibur/store/impl/AbstractFilesystemStore.java
  
  Index: AbstractFilesystemStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/store/src/java/org/apache/excalibur/store/impl/AbstractFilesystemStore.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractFilesystemStore.java	13 Jun 2002 17:24:52 -0000	1.3
  +++ AbstractFilesystemStore.java	14 Aug 2002 15:33:53 -0000	1.4
  @@ -161,6 +161,20 @@
       }
   
       /**
  +     * Clear the Store of all elements 
  +     */
  +    public synchronized void clear() {
  +                Enumeration enum = this.keys();
  +                while (enum.hasMoreElements()) {
  +                    Object key = enum.nextElement();
  +                    if (key == null) {
  +                        continue;
  +                    }
  +                        this.remove(key);
  +                 }
  +    }
  +
  +    /**
        * Indicates if the given key is associated to a contained object.
        */
       public synchronized boolean containsKey(final Object key) {
  
  
  
  1.6       +15 -1     jakarta-avalon-excalibur/store/src/java/org/apache/excalibur/store/impl/MRUMemoryStore.java
  
  Index: MRUMemoryStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/store/src/java/org/apache/excalibur/store/impl/MRUMemoryStore.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MRUMemoryStore.java	10 Jul 2002 09:40:17 -0000	1.5
  +++ MRUMemoryStore.java	14 Aug 2002 15:33:53 -0000	1.6
  @@ -222,6 +222,20 @@
       }
   
       /**
  +     * Clear the Store of all elements 
  +     */
  +    public synchronized void clear() {
  +                Enumeration enum = this.cache.keys();
  +                while (enum.hasMoreElements()) {
  +                    Object key = enum.nextElement();
  +                    if (key == null) {
  +                        continue;
  +                    }
  +                        this.remove(key);
  +                 }
  +    }
  +
  +    /**
        * Indicates if the given key is associated to a contained object.
        *
        * @param key The key of the object
  
  
  
  1.2       +8 -1      jakarta-avalon-excalibur/store/src/java/org/apache/excalibur/store/impl/MemoryStore.java
  
  Index: MemoryStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/store/src/java/org/apache/excalibur/store/impl/MemoryStore.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MemoryStore.java	2 May 2002 08:55:39 -0000	1.1
  +++ MemoryStore.java	14 Aug 2002 15:33:53 -0000	1.2
  @@ -68,6 +68,13 @@
           table.remove(key);
       }
   
  +    /**
  +     * Clear the Store of all elements 
  +     */
  +    public synchronized void clear() {
  +        table.clear();
  +    }
  +
       public synchronized void free() {}
   
       /**
  
  
  

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


Mime
View raw message