org.apache.naming.resources
public class ResourceCache extends Object
Version: $Revision: 467222 $
Field Summary | |
---|---|
protected long | accessCount
Number of accesses to the cache. |
protected CacheEntry[] | cache
Cache.
|
protected int | cacheMaxSize
Max size of resources which will have their content cached. |
protected int | cacheSize
Current cache size in KB. |
protected long | desiredEntryAccessRatio
Entry hit ratio at which an entry will never be removed from the cache.
|
protected long | hitsCount
Number of cache hits. |
protected int | maxAllocateIterations
Max amount of removals during a make space. |
protected HashMap | notFoundCache
Not found cache. |
protected Random | random
Random generator used to determine elements to free. |
protected int | spareNotFoundEntries
Spare 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(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(String name) |