Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » naming » resources » [javadoc | source]
org.apache.naming.resources
public class: ResourceCache [javadoc | source]
java.lang.Object
   org.apache.naming.resources.ResourceCache
Implements a special purpose cache.
Field Summary
protected  Random random    Random generator used to determine elements to free. 
protected  CacheEntry[] cache    Cache. Path -> Cache entry. 
protected  HashMap notFoundCache    Not found cache. 
protected  int cacheMaxSize    Max size of resources which will have their content cached. 
protected  int maxAllocateIterations    Max amount of removals during a make space. 
protected  long desiredEntryAccessRatio    Entry hit ratio at which an entry will never be removed from the cache. Compared with entry.access / hitsCount 
protected  int spareNotFoundEntries    Spare amount of not found entries. 
protected  int cacheSize    Current cache size in KB. 
protected  long accessCount    Number of accesses to the cache. 
protected  long hitsCount    Number of cache hits. 
Constructor:
 public ResourceCache() 
Method from org.apache.naming.resources.ResourceCache Summary:
allocate,   getAccessCount,   getCacheMaxSize,   getCacheSize,   getDesiredEntryAccessRatio,   getHitsCount,   getMaxAllocateIterations,   getSpareNotFoundEntries,   load,   lookup,   setCacheMaxSize,   setDesiredEntryAccessRatio,   setMaxAllocateIterations,   setSpareNotFoundEntries,   unload
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.naming.resources.ResourceCache Detail:
 public boolean allocate(int space) 
 public long getAccessCount() 
    Return the access count. Note: Update is not synced, so the number may not be completely accurate.
 public int getCacheMaxSize() 
    Return the maximum size of the cache in KB.
 public int getCacheSize() 
    Return the current cache size in KB.
 public long getDesiredEntryAccessRatio() 
    Return desired entry access ratio.
 public long getHitsCount() 
    Return the number of cache hits. Note: Update is not synced, so the number may not be completely accurate.
 public int getMaxAllocateIterations() 
    Return the maximum amount of iterations during a space allocation.
 public int getSpareNotFoundEntries() 
    Return the amount of spare not found entries.
 public  void load(CacheEntry entry) 
 public CacheEntry lookup(String name) 
 public  void setCacheMaxSize(int cacheMaxSize) 
    Set the maximum size of the cache in KB.
 public  void setDesiredEntryAccessRatio(long desiredEntryAccessRatio) 
    Set the desired entry access ratio.
 public  void setMaxAllocateIterations(int maxAllocateIterations) 
    Set the maximum amount of iterations during a space allocation.
 public  void setSpareNotFoundEntries(int spareNotFoundEntries) 
    Set the amount of spare not found entries.
 public boolean unload(String name)