org.hibernate.cache.ehcache.management.impl
Class EhcacheStatsImpl

java.lang.Object
  extended by javax.management.StandardMBean
      extended by org.hibernate.cache.ehcache.management.impl.BaseEmitterBean
          extended by org.hibernate.cache.ehcache.management.impl.EhcacheStatsImpl
All Implemented Interfaces:
DynamicMBean, MBeanRegistration, NotificationBroadcaster, NotificationEmitter, net.sf.ehcache.hibernate.management.api.EhcacheStats

public class EhcacheStatsImpl
extends BaseEmitterBean
implements net.sf.ehcache.hibernate.management.api.EhcacheStats

Implementation of EhcacheStats


Field Summary
 
Fields inherited from class org.hibernate.cache.ehcache.management.impl.BaseEmitterBean
emitter, sequenceNumber
 
Fields inherited from interface net.sf.ehcache.hibernate.management.api.EhcacheStats
CACHE_ENABLED, CACHE_FLUSHED, CACHE_REGION_CHANGED, CACHE_REGION_FLUSHED, CACHE_STATISTICS_ENABLED, CACHE_STATISTICS_RESET
 
Constructor Summary
EhcacheStatsImpl(net.sf.ehcache.CacheManager manager)
          Constructor accepting the backing CacheManager
 
Method Summary
 void clearStats()
          
 void disableStats()
          
protected  void doDispose()
          Dispose callback of subclasses
 void enableStats()
          
 void flushRegionCache(String region)
          
 void flushRegionCaches()
          
 String generateActiveConfigDeclaration()
          
 String generateActiveConfigDeclaration(String region)
          
 float getAverageGetTimeMillis(String region)
          
 long getCacheHitCount()
          
 double getCacheHitRate()
          
 long getCacheHitSample()
          
 long getCacheMissCount()
          
 double getCacheMissRate()
          
 long getCacheMissSample()
          
 long getCachePutCount()
          
 double getCachePutRate()
          
 long getCachePutSample()
          
 long getMaxGetTimeMillis()
          
 long getMaxGetTimeMillis(String cacheName)
          
 long getMinGetTimeMillis()
          
 long getMinGetTimeMillis(String cacheName)
          
 MBeanNotificationInfo[] getNotificationInfo()
           
 int getNumberOfElementsInMemory(String region)
          
 int getNumberOfElementsOffHeap(String region)
          
 int getNumberOfElementsOnDisk(String region)
          
 String getOriginalConfigDeclaration()
          
 String getOriginalConfigDeclaration(String region)
          
 Map<String,Map<String,Object>> getRegionCacheAttributes()
          
 Map<String,Object> getRegionCacheAttributes(String regionName)
          
 int getRegionCacheMaxTTISeconds(String region)
          
 int getRegionCacheMaxTTLSeconds(String region)
          
 int getRegionCacheOrphanEvictionPeriod(String region)
          
 Map<String,int[]> getRegionCacheSamples()
          
 int getRegionCacheTargetMaxInMemoryCount(String region)
          
 int getRegionCacheTargetMaxTotalCount(String region)
          
 String[] getTerracottaHibernateCacheRegionNames()
          
 boolean isRegionCacheEnabled(String region)
          
 boolean isRegionCacheLoggingEnabled(String region)
          
 boolean isRegionCacheOrphanEvictionEnabled(String region)
          
 boolean isRegionCachesEnabled()
          
 boolean isStatisticsEnabled()
          
 boolean isTerracottaHibernateCache(String region)
          
 void setRegionCacheEnabled(String region, boolean enabled)
          
 void setRegionCacheLoggingEnabled(String region, boolean loggingEnabled)
          
 void setRegionCacheMaxTTISeconds(String region, int maxTTISeconds)
          
 void setRegionCacheMaxTTLSeconds(String region, int maxTTLSeconds)
          
 void setRegionCachesEnabled(boolean flag)
           
 void setRegionCacheTargetMaxInMemoryCount(String region, int targetMaxInMemoryCount)
          
 void setRegionCacheTargetMaxTotalCount(String region, int targetMaxTotalCount)
          
 void setStatisticsEnabled(boolean flag)
          
 
Methods inherited from class org.hibernate.cache.ehcache.management.impl.BaseEmitterBean
addNotificationListener, dispose, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification
 
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.management.NotificationEmitter
removeNotificationListener
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, removeNotificationListener
 

Constructor Detail

EhcacheStatsImpl

public EhcacheStatsImpl(net.sf.ehcache.CacheManager manager)
                 throws NotCompliantMBeanException
Constructor accepting the backing CacheManager

Throws:
NotCompliantMBeanException
Method Detail

isStatisticsEnabled

public boolean isStatisticsEnabled()

Specified by:
isStatisticsEnabled in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

clearStats

public void clearStats()

Specified by:
clearStats in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

disableStats

public void disableStats()

Specified by:
disableStats in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

enableStats

public void enableStats()

Specified by:
enableStats in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

flushRegionCache

public void flushRegionCache(String region)

Specified by:
flushRegionCache in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

flushRegionCaches

public void flushRegionCaches()

Specified by:
flushRegionCaches in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

generateActiveConfigDeclaration

public String generateActiveConfigDeclaration()

Specified by:
generateActiveConfigDeclaration in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

generateActiveConfigDeclaration

public String generateActiveConfigDeclaration(String region)

Specified by:
generateActiveConfigDeclaration in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getCacheHitCount

public long getCacheHitCount()

Specified by:
getCacheHitCount in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getCacheHitRate

public double getCacheHitRate()

Specified by:
getCacheHitRate in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getCacheHitSample

public long getCacheHitSample()

Specified by:
getCacheHitSample in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getCacheMissCount

public long getCacheMissCount()

Specified by:
getCacheMissCount in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getCacheMissRate

public double getCacheMissRate()

Specified by:
getCacheMissRate in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getCacheMissSample

public long getCacheMissSample()

Specified by:
getCacheMissSample in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getCachePutCount

public long getCachePutCount()

Specified by:
getCachePutCount in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getCachePutRate

public double getCachePutRate()

Specified by:
getCachePutRate in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getCachePutSample

public long getCachePutSample()

Specified by:
getCachePutSample in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getOriginalConfigDeclaration

public String getOriginalConfigDeclaration()

Specified by:
getOriginalConfigDeclaration in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getOriginalConfigDeclaration

public String getOriginalConfigDeclaration(String region)

Specified by:
getOriginalConfigDeclaration in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getRegionCacheAttributes

public Map<String,Map<String,Object>> getRegionCacheAttributes()

Specified by:
getRegionCacheAttributes in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getRegionCacheAttributes

public Map<String,Object> getRegionCacheAttributes(String regionName)

Specified by:
getRegionCacheAttributes in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getRegionCacheMaxTTISeconds

public int getRegionCacheMaxTTISeconds(String region)

Specified by:
getRegionCacheMaxTTISeconds in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getRegionCacheMaxTTLSeconds

public int getRegionCacheMaxTTLSeconds(String region)

Specified by:
getRegionCacheMaxTTLSeconds in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getRegionCacheOrphanEvictionPeriod

public int getRegionCacheOrphanEvictionPeriod(String region)

Specified by:
getRegionCacheOrphanEvictionPeriod in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getRegionCacheSamples

public Map<String,int[]> getRegionCacheSamples()

Specified by:
getRegionCacheSamples in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getRegionCacheTargetMaxInMemoryCount

public int getRegionCacheTargetMaxInMemoryCount(String region)

Specified by:
getRegionCacheTargetMaxInMemoryCount in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getRegionCacheTargetMaxTotalCount

public int getRegionCacheTargetMaxTotalCount(String region)

Specified by:
getRegionCacheTargetMaxTotalCount in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getTerracottaHibernateCacheRegionNames

public String[] getTerracottaHibernateCacheRegionNames()

Specified by:
getTerracottaHibernateCacheRegionNames in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

isRegionCacheEnabled

public boolean isRegionCacheEnabled(String region)

Specified by:
isRegionCacheEnabled in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

setRegionCacheEnabled

public void setRegionCacheEnabled(String region,
                                  boolean enabled)

Specified by:
setRegionCacheEnabled in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

isRegionCachesEnabled

public boolean isRegionCachesEnabled()

Specified by:
isRegionCachesEnabled in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

setRegionCachesEnabled

public void setRegionCachesEnabled(boolean flag)
Specified by:
setRegionCachesEnabled in interface net.sf.ehcache.hibernate.management.api.EhcacheStats
See Also:
EhcacheStats.setRegionCachesEnabled(boolean)

isRegionCacheLoggingEnabled

public boolean isRegionCacheLoggingEnabled(String region)

Specified by:
isRegionCacheLoggingEnabled in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

isRegionCacheOrphanEvictionEnabled

public boolean isRegionCacheOrphanEvictionEnabled(String region)

Specified by:
isRegionCacheOrphanEvictionEnabled in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

isTerracottaHibernateCache

public boolean isTerracottaHibernateCache(String region)

Specified by:
isTerracottaHibernateCache in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

setRegionCacheLoggingEnabled

public void setRegionCacheLoggingEnabled(String region,
                                         boolean loggingEnabled)

Specified by:
setRegionCacheLoggingEnabled in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

setRegionCacheMaxTTISeconds

public void setRegionCacheMaxTTISeconds(String region,
                                        int maxTTISeconds)

Specified by:
setRegionCacheMaxTTISeconds in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

setRegionCacheMaxTTLSeconds

public void setRegionCacheMaxTTLSeconds(String region,
                                        int maxTTLSeconds)

Specified by:
setRegionCacheMaxTTLSeconds in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

setRegionCacheTargetMaxInMemoryCount

public void setRegionCacheTargetMaxInMemoryCount(String region,
                                                 int targetMaxInMemoryCount)

Specified by:
setRegionCacheTargetMaxInMemoryCount in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

setRegionCacheTargetMaxTotalCount

public void setRegionCacheTargetMaxTotalCount(String region,
                                              int targetMaxTotalCount)

Specified by:
setRegionCacheTargetMaxTotalCount in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getNumberOfElementsInMemory

public int getNumberOfElementsInMemory(String region)

Specified by:
getNumberOfElementsInMemory in interface net.sf.ehcache.hibernate.management.api.EhcacheStats
See Also:
EhcacheStats.getNumberOfElementsInMemory(java.lang.String)

getNumberOfElementsOffHeap

public int getNumberOfElementsOffHeap(String region)

Specified by:
getNumberOfElementsOffHeap in interface net.sf.ehcache.hibernate.management.api.EhcacheStats
See Also:
EhcacheStats.getNumberOfElementsOffHeap(java.lang.String)

getNumberOfElementsOnDisk

public int getNumberOfElementsOnDisk(String region)

Specified by:
getNumberOfElementsOnDisk in interface net.sf.ehcache.hibernate.management.api.EhcacheStats
See Also:
EhcacheStats.getNumberOfElementsOnDisk(java.lang.String)

setStatisticsEnabled

public void setStatisticsEnabled(boolean flag)

Specified by:
setStatisticsEnabled in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getMaxGetTimeMillis

public long getMaxGetTimeMillis()

Specified by:
getMaxGetTimeMillis in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getMinGetTimeMillis

public long getMinGetTimeMillis()

Specified by:
getMinGetTimeMillis in interface net.sf.ehcache.hibernate.management.api.EhcacheStats

getMaxGetTimeMillis

public long getMaxGetTimeMillis(String cacheName)

Specified by:
getMaxGetTimeMillis in interface net.sf.ehcache.hibernate.management.api.EhcacheStats
See Also:
EhcacheStats.getMaxGetTimeMillis(java.lang.String)

getMinGetTimeMillis

public long getMinGetTimeMillis(String cacheName)

Specified by:
getMinGetTimeMillis in interface net.sf.ehcache.hibernate.management.api.EhcacheStats
See Also:
EhcacheStats.getMinGetTimeMillis(java.lang.String)

getAverageGetTimeMillis

public float getAverageGetTimeMillis(String region)

Specified by:
getAverageGetTimeMillis in interface net.sf.ehcache.hibernate.management.api.EhcacheStats
See Also:
EhcacheStats.getAverageGetTimeMillis(java.lang.String)

doDispose

protected void doDispose()
Dispose callback of subclasses

Specified by:
doDispose in class BaseEmitterBean

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster
Specified by:
getNotificationInfo in class BaseEmitterBean
See Also:
BaseEmitterBean.getNotificationInfo()


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.