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 ConcurrentCache
cache
-
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 void
checkPermission()
long
getAllocatedEntries()
Get the number of entries currently allocated in the cache.boolean
getCollectAccessCounts()
Check if collection of cache access counts is enabled.long
getEvictionCount()
Get the number of cached objects that have been evicted from the cache in order to make room for other objects.long
getHitCount()
Get the number of cache accesses where the requested object was already in the cache.long
getMaxEntries()
Get the maximum number of entries that could be held by this cache.long
getMissCount()
Get the number of cache accesses where the requested object was not already in the cache.long
getUsedEntries()
Get the number of objects that are currently in the cache.void
setCollectAccessCounts(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:CacheManagerMBean
Enable 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:
setCollectAccessCounts
in interfaceCacheManagerMBean
- Parameters:
collect
-true
if access counts should be collected, orfalse
otherwise- See Also:
CacheManagerMBean.getCollectAccessCounts()
,CacheManagerMBean.getHitCount()
,CacheManagerMBean.getMissCount()
,CacheManagerMBean.getEvictionCount()
-
getCollectAccessCounts
public boolean getCollectAccessCounts()
Description copied from interface:CacheManagerMBean
Check if collection of cache access counts is enabled.- Specified by:
getCollectAccessCounts
in interfaceCacheManagerMBean
- Returns:
true
if access counts are enabled,false
otherwise- See Also:
CacheManagerMBean.setCollectAccessCounts(boolean)
-
getHitCount
public long getHitCount()
Description copied from interface:CacheManagerMBean
Get the number of cache accesses where the requested object was already in the cache.- Specified by:
getHitCount
in interfaceCacheManagerMBean
- Returns:
- the number of cache hits
-
getMissCount
public long getMissCount()
Description copied from interface:CacheManagerMBean
Get the number of cache accesses where the requested object was not already in the cache.- Specified by:
getMissCount
in interfaceCacheManagerMBean
- Returns:
- the number of cache misses
-
getEvictionCount
public long getEvictionCount()
Description copied from interface:CacheManagerMBean
Get the number of cached objects that have been evicted from the cache in order to make room for other objects.- Specified by:
getEvictionCount
in interfaceCacheManagerMBean
- Returns:
- the number of evicted objects
-
getMaxEntries
public long getMaxEntries()
Description copied from interface:CacheManagerMBean
Get the maximum number of entries that could be held by this cache.- Specified by:
getMaxEntries
in interfaceCacheManagerMBean
- Returns:
- the maximum number of entries in the cache
-
getAllocatedEntries
public long getAllocatedEntries()
Description copied from interface:CacheManagerMBean
Get 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:
getAllocatedEntries
in interfaceCacheManagerMBean
- Returns:
- the number of entries in the cache
-
getUsedEntries
public long getUsedEntries()
Description copied from interface:CacheManagerMBean
Get the number of objects that are currently in the cache.- Specified by:
getUsedEntries
in interfaceCacheManagerMBean
- Returns:
- the number of objects in the cache
-
checkPermission
private static void checkPermission()
-
-