Package org.apache.jackrabbit.core.cache
Interface Cache
-
- All Known Implementing Classes:
AbstractCache
,ConcurrentCache
public interface Cache
ACache
object 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 long
getAccessCount()
Get the number of accesses (get or set) until resetAccessCount was called.String
getCacheInfoAsString()
Gathers the stats of the cache for logging.long
getElementCount()
Get the number of elements/objects in the cache.long
getMaxMemorySize()
Get the current limit.long
getMemoryUsed()
Get the amount of used memory.long
getMissCount()
Get the number of cache misses.long
getTotalAccessCount()
Get the total number of cache accesses.void
resetAccessCount()
Reset the access counter.void
resetMissCount()
Reset the cache miss counter.void
setAccessListener(CacheAccessListener listener)
Add a listener to this cache that is informed after a number of accesses.void
setMaxMemorySize(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.
-
-