## org.hibernate.cache.ehcache.management.impl
Class EhcacheHibernate

    java.lang.Object
      javax.management.StandardMBean
          org.hibernate.cache.ehcache.management.impl.BaseEmitterBean
              org.hibernate.cache.ehcache.management.impl.EhcacheHibernate

All Implemented Interfaces:
  DynamicMBean, MBeanRegistration, NotificationBroadcaster, NotificationEmitter, net.sf.ehcache.hibernate.management.api.EhcacheHibernateMBean, net.sf.ehcache.hibernate.management.api.EhcacheStats, net.sf.ehcache.hibernate.management.api.HibernateStats

    public class EhcacheHibernate

extends BaseEmitterBean
implements net.sf.ehcache.hibernate.management.api.EhcacheHibernateMBean

Implementation of the `EhcacheHibernateMBean`

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`

Fields inherited from interface net.sf.ehcache.hibernate.management.api.HibernateStats
`CACHE_ENABLED, CACHE_FLUSHED, CACHE_REGION_CHANGED, CACHE_REGION_FLUSHED, CACHE_STATISTICS_ENABLED, CACHE_STATISTICS_RESET`

Constructor Summary
`EhcacheHibernate(net.sf.ehcache.CacheManager manager)` Constructor accepting the backing `CacheManager`

Method Summary
`void` `clearStats()`
`void` `disableStats()`
`protected void` `doDispose()` Dispose callback of subclasses
`void` `enableHibernateStatistics(SessionFactory sessionFactory)` Enable hibernate statistics with the input session factory
`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()`
`TabularData` `getCacheRegionStats()`
`long` `getCloseStatementCount()`
`TabularData` `getCollectionStats()`
`long` `getConnectCount()`
`TabularData` `getEntityStats()`
`long` `getFlushCount()`
`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)`
`long` `getOptimisticFailureCount()`
`String` `getOriginalConfigDeclaration()`
`String` `getOriginalConfigDeclaration(String region)`
`long` `getPrepareStatementCount()`
`long` `getQueryExecutionCount()`
`double` `getQueryExecutionRate()`
`long` `getQueryExecutionSample()`
`TabularData` `getQueryStats()`
`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)`
`long` `getSessionCloseCount()`
`long` `getSessionOpenCount()`
`long` `getSuccessfulTransactionCount()`
`String[]` `getTerracottaHibernateCacheRegionNames()`
`long` `getTransactionCount()`
`boolean` `isHibernateStatisticsSupported()`
`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 enabled)`
`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

### EhcacheHibernate

    public EhcacheHibernate(net.sf.ehcache.CacheManager manager)
                     throws NotCompliantMBeanException

  Constructor accepting the backing `CacheManager`

  Parameters:
    `manager` - the backing `CacheManager`
  Throws:
    `NotCompliantMBeanException`

Method Detail

### enableHibernateStatistics

    public void enableHibernateStatistics(SessionFactory sessionFactory)

  Enable hibernate statistics with the input session factory

### isHibernateStatisticsSupported

    public boolean isHibernateStatisticsSupported()

  Specified by:
    `isHibernateStatisticsSupported` in interface `net.sf.ehcache.hibernate.management.api.EhcacheHibernateMBean`

### setStatisticsEnabled

    public void setStatisticsEnabled(boolean flag)

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

### isStatisticsEnabled

    public boolean isStatisticsEnabled()

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

### clearStats

    public void clearStats()

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

### disableStats

    public void disableStats()

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

### enableStats

    public void enableStats()

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

### 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`

### getCacheRegionStats

    public TabularData getCacheRegionStats()

  Specified by:
    `getCacheRegionStats` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getCloseStatementCount

    public long getCloseStatementCount()

  Specified by:
    `getCloseStatementCount` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getCollectionStats

    public TabularData getCollectionStats()

  Specified by:
    `getCollectionStats` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getConnectCount

    public long getConnectCount()

  Specified by:
    `getConnectCount` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getEntityStats

    public TabularData getEntityStats()

  Specified by:
    `getEntityStats` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getFlushCount

    public long getFlushCount()

  Specified by:
    `getFlushCount` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getOptimisticFailureCount

    public long getOptimisticFailureCount()

  Specified by:
    `getOptimisticFailureCount` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### 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`

### getPrepareStatementCount

    public long getPrepareStatementCount()

  Specified by:
    `getPrepareStatementCount` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getQueryExecutionCount

    public long getQueryExecutionCount()

  Specified by:
    `getQueryExecutionCount` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getQueryExecutionRate

    public double getQueryExecutionRate()

  Specified by:
    `getQueryExecutionRate` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getQueryExecutionSample

    public long getQueryExecutionSample()

  Specified by:
    `getQueryExecutionSample` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getQueryStats

    public TabularData getQueryStats()

  Specified by:
    `getQueryStats` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### 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`

### getSessionCloseCount

    public long getSessionCloseCount()

  Specified by:
    `getSessionCloseCount` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getSessionOpenCount

    public long getSessionOpenCount()

  Specified by:
    `getSessionOpenCount` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getSuccessfulTransactionCount

    public long getSuccessfulTransactionCount()

  Specified by:
    `getSuccessfulTransactionCount` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### getTerracottaHibernateCacheRegionNames

    public String[] getTerracottaHibernateCacheRegionNames()

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

### getTransactionCount

    public long getTransactionCount()

  Specified by:
    `getTransactionCount` in interface `net.sf.ehcache.hibernate.management.api.HibernateStats`

### isRegionCacheEnabled

    public boolean isRegionCacheEnabled(String region)

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

### setRegionCachesEnabled

    public void setRegionCachesEnabled(boolean enabled)

  Specified by:
    `setRegionCachesEnabled` 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`

### 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`

### isRegionCachesEnabled

    public boolean isRegionCachesEnabled()

  Specified by:
    `isRegionCachesEnabled` 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.getNumberOfElementsInMemory(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)`

### getMaxGetTimeMillis

    public long getMaxGetTimeMillis()

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

### 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()

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

### 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.