View Javadoc

1   /*
2    * Copyright (c) 2004-2005, University Health Network.  All rights reserved. Distributed under the BSD 
3    * license (see http://opensource.org/licenses/bsd-license.php).
4    *  
5    * Created on 4-Jan-2005
6    */
7   package ca.uhn.cache.internal;
8   
9   /***
10   * Responsible for cleaning two kinds of records out of a ChunkBasedCache: records  
11   * that are likely to be out of date (stale), and (if the cache is too full) records 
12   * that are not likely to be accessed in the near future.  
13   *  
14   * @author <a href="mailto:bryan.tripp@uhn.on.ca">Bryan Tripp</a>
15   * @version $Revision: 1.1 $ updated on $Date: 2005/01/24 22:53:27 $ by $Author: bryan_tripp $
16   */
17  public interface ICacheCleaner {
18  
19      /***
20       * @return target size of cache: if there are more records than this in the cache, 
21       *      less useful records will be evicted  
22       */
23      public long getTargetSize();
24      
25      /***
26       * Removes from the cache any chunks that are older than their maximum age.
27       */
28      public void evictStaleChunks();
29      
30      /***
31       * Removes from the cache any chunks that are unlikely to be used in the near future, 
32       * according to getUnusedChunkRule(). 
33       */
34      public void evictUnusedChunks();
35      
36  }