Class ConcurrentCacheMBeanImpl
java.lang.Object
org.apache.derby.impl.services.cache.ConcurrentCacheMBeanImpl
- All Implemented Interfaces:
CacheManagerMBean
This class provides monitoring capabilities for ConcurrentCache through
Java Management Extension (JMX).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidlongGet the number of entries currently allocated in the cache.booleanCheck if collection of cache access counts is enabled.longGet the number of cached objects that have been evicted from the cache in order to make room for other objects.longGet the number of cache accesses where the requested object was already in the cache.longGet the maximum number of entries that could be held by this cache.longGet the number of cache accesses where the requested object was not already in the cache.longGet the number of objects that are currently in the cache.voidsetCollectAccessCounts(boolean collect) Enable or disable collection of cache access counts.
-
Field Details
-
cache
-
-
Constructor Details
-
ConcurrentCacheMBeanImpl
ConcurrentCacheMBeanImpl(ConcurrentCache cache)
-
-
Method Details
-
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:
-
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:
-
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()
-