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 void
long
Get the number of entries currently allocated in the cache.boolean
Check if collection of cache access counts is enabled.long
Get the number of cached objects that have been evicted from the cache in order to make room for other objects.long
Get the number of cache accesses where the requested object was already in the cache.long
Get the maximum number of entries that could be held by this cache.long
Get the number of cache accesses where the requested object was not already in the cache.long
Get the number of objects that are currently in the cache.void
setCollectAccessCounts
(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: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:
-
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:
-
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()
-