Class ConcurrentCacheMBeanImpl
- java.lang.Object
-
- org.apache.derby.impl.services.cache.ConcurrentCacheMBeanImpl
-
- All Implemented Interfaces:
CacheManagerMBean
final class ConcurrentCacheMBeanImpl extends java.lang.Object implements CacheManagerMBean
This class provides monitoring capabilities for ConcurrentCache through Java Management Extension (JMX).
-
-
Field Summary
Fields Modifier and Type Field Description private ConcurrentCachecache
-
Constructor Summary
Constructors Constructor Description ConcurrentCacheMBeanImpl(ConcurrentCache cache)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static voidcheckPermission()longgetAllocatedEntries()Get the number of entries currently allocated in the cache.booleangetCollectAccessCounts()Check if collection of cache access counts is enabled.longgetEvictionCount()Get the number of cached objects that have been evicted from the cache in order to make room for other objects.longgetHitCount()Get the number of cache accesses where the requested object was already in the cache.longgetMaxEntries()Get the maximum number of entries that could be held by this cache.longgetMissCount()Get the number of cache accesses where the requested object was not already in the cache.longgetUsedEntries()Get the number of objects that are currently in the cache.voidsetCollectAccessCounts(boolean collect)Enable or disable collection of cache access counts.
-
-
-
Field Detail
-
cache
private final ConcurrentCache cache
-
-
Constructor Detail
-
ConcurrentCacheMBeanImpl
ConcurrentCacheMBeanImpl(ConcurrentCache cache)
-
-
Method Detail
-
setCollectAccessCounts
public void setCollectAccessCounts(boolean collect)
Description copied from interface:CacheManagerMBeanEnable or disable collection of cache access counts. That is, whether or not each hit, miss and eviction should be counted. Enabling it might impose a small overhead on cache accesses, and might reduce the system performance. Access counts are disabled by default.- Specified by:
setCollectAccessCountsin interfaceCacheManagerMBean- Parameters:
collect-trueif access counts should be collected, orfalseotherwise- See Also:
CacheManagerMBean.getCollectAccessCounts(),CacheManagerMBean.getHitCount(),CacheManagerMBean.getMissCount(),CacheManagerMBean.getEvictionCount()
-
getCollectAccessCounts
public boolean getCollectAccessCounts()
Description copied from interface:CacheManagerMBeanCheck if collection of cache access counts is enabled.- Specified by:
getCollectAccessCountsin interfaceCacheManagerMBean- Returns:
trueif access counts are enabled,falseotherwise- See Also:
CacheManagerMBean.setCollectAccessCounts(boolean)
-
getHitCount
public long getHitCount()
Description copied from interface:CacheManagerMBeanGet the number of cache accesses where the requested object was already in the cache.- Specified by:
getHitCountin interfaceCacheManagerMBean- Returns:
- the number of cache hits
-
getMissCount
public long getMissCount()
Description copied from interface:CacheManagerMBeanGet the number of cache accesses where the requested object was not already in the cache.- Specified by:
getMissCountin interfaceCacheManagerMBean- Returns:
- the number of cache misses
-
getEvictionCount
public long getEvictionCount()
Description copied from interface:CacheManagerMBeanGet the number of cached objects that have been evicted from the cache in order to make room for other objects.- Specified by:
getEvictionCountin interfaceCacheManagerMBean- Returns:
- the number of evicted objects
-
getMaxEntries
public long getMaxEntries()
Description copied from interface:CacheManagerMBeanGet the maximum number of entries that could be held by this cache.- Specified by:
getMaxEntriesin interfaceCacheManagerMBean- Returns:
- the maximum number of entries in the cache
-
getAllocatedEntries
public long getAllocatedEntries()
Description copied from interface:CacheManagerMBeanGet the number of entries currently allocated in the cache. This number includes entries for objects that have been removed from the cache, whose entries have not yet been reused for other objects.- Specified by:
getAllocatedEntriesin interfaceCacheManagerMBean- Returns:
- the number of entries in the cache
-
getUsedEntries
public long getUsedEntries()
Description copied from interface:CacheManagerMBeanGet the number of objects that are currently in the cache.- Specified by:
getUsedEntriesin interfaceCacheManagerMBean- Returns:
- the number of objects in the cache
-
checkPermission
private static void checkPermission()
-
-