| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.naming.resources.ResourceCache
public class ResourceCache
Implements a special purpose cache.
| Field Summary | |
|---|---|
| protected  long | accessCountNumber of accesses to the cache. | 
| protected  CacheEntry[] | cacheCache. | 
| protected  int | cacheMaxSizeMax size of resources which will have their content cached. | 
| protected  int | cacheSizeCurrent cache size in KB. | 
| protected  long | desiredEntryAccessRatioEntry hit ratio at which an entry will never be removed from the cache. | 
| protected  long | hitsCountNumber of cache hits. | 
| protected  int | maxAllocateIterationsMax amount of removals during a make space. | 
| protected  java.util.HashMap | notFoundCacheNot found cache. | 
| protected  java.util.Random | randomRandom generator used to determine elements to free. | 
| protected  int | spareNotFoundEntriesSpare amount of not found entries. | 
| Constructor Summary | |
|---|---|
| ResourceCache() | |
| Method Summary | |
|---|---|
|  boolean | allocate(int space) | 
|  long | getAccessCount()Return the access count. | 
|  int | getCacheMaxSize()Return the maximum size of the cache in KB. | 
|  int | getCacheSize()Return the current cache size in KB. | 
|  long | getDesiredEntryAccessRatio()Return desired entry access ratio. | 
|  long | getHitsCount()Return the number of cache hits. | 
|  int | getMaxAllocateIterations()Return the maximum amount of iterations during a space allocation. | 
|  int | getSpareNotFoundEntries()Return the amount of spare not found entries. | 
|  void | load(CacheEntry entry) | 
|  CacheEntry | lookup(java.lang.String name) | 
|  void | setCacheMaxSize(int cacheMaxSize)Set the maximum size of the cache in KB. | 
|  void | setDesiredEntryAccessRatio(long desiredEntryAccessRatio)Set the desired entry access ratio. | 
|  void | setMaxAllocateIterations(int maxAllocateIterations)Set the maximum amount of iterations during a space allocation. | 
|  void | setSpareNotFoundEntries(int spareNotFoundEntries)Set the amount of spare not found entries. | 
|  boolean | unload(java.lang.String name) | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected java.util.Random random
protected CacheEntry[] cache
protected java.util.HashMap notFoundCache
protected int cacheMaxSize
protected int maxAllocateIterations
protected long desiredEntryAccessRatio
protected int spareNotFoundEntries
protected int cacheSize
protected long accessCount
protected long hitsCount
| Constructor Detail | 
|---|
public ResourceCache()
| Method Detail | 
|---|
public long getAccessCount()
public int getCacheMaxSize()
public void setCacheMaxSize(int cacheMaxSize)
public int getCacheSize()
public long getDesiredEntryAccessRatio()
public void setDesiredEntryAccessRatio(long desiredEntryAccessRatio)
public long getHitsCount()
public int getMaxAllocateIterations()
public void setMaxAllocateIterations(int maxAllocateIterations)
public int getSpareNotFoundEntries()
public void setSpareNotFoundEntries(int spareNotFoundEntries)
public boolean allocate(int space)
public CacheEntry lookup(java.lang.String name)
public void load(CacheEntry entry)
public boolean unload(java.lang.String name)
| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||