Package org.apache.jackrabbit.core.cache
Interface Cache
-
- All Known Implementing Classes:
AbstractCache,ConcurrentCache
public interface CacheACacheobject A cache must callCacheManager.getInstance().add(this)to take part in the dynamic memory distribution.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetAccessCount()Get the number of accesses (get or set) until resetAccessCount was called.StringgetCacheInfoAsString()Gathers the stats of the cache for logging.longgetElementCount()Get the number of elements/objects in the cache.longgetMaxMemorySize()Get the current limit.longgetMemoryUsed()Get the amount of used memory.longgetMissCount()Get the number of cache misses.longgetTotalAccessCount()Get the total number of cache accesses.voidresetAccessCount()Reset the access counter.voidresetMissCount()Reset the cache miss counter.voidsetAccessListener(CacheAccessListener listener)Add a listener to this cache that is informed after a number of accesses.voidsetMaxMemorySize(long size)Set the new memory limit.
-
-
-
Method Detail
-
setMaxMemorySize
void setMaxMemorySize(long size)
Set the new memory limit.- Parameters:
size- the size in bytes
-
getMaxMemorySize
long getMaxMemorySize()
Get the current limit.- Returns:
- the size in bytes
-
getMemoryUsed
long getMemoryUsed()
Get the amount of used memory.- Returns:
- the size in bytes
-
getAccessCount
long getAccessCount()
Get the number of accesses (get or set) until resetAccessCount was called.- Returns:
- the count
-
resetAccessCount
void resetAccessCount()
Reset the access counter.
-
getTotalAccessCount
long getTotalAccessCount()
Get the total number of cache accesses.- Returns:
- the number of hits
-
getMissCount
long getMissCount()
Get the number of cache misses.- Returns:
- the number of misses
-
resetMissCount
void resetMissCount()
Reset the cache miss counter.
-
getElementCount
long getElementCount()
Get the number of elements/objects in the cache.- Returns:
- the number of elements
-
setAccessListener
void setAccessListener(CacheAccessListener listener)
Add a listener to this cache that is informed after a number of accesses.
-
getCacheInfoAsString
String getCacheInfoAsString()
Gathers the stats of the cache for logging.
-
-