Top Description Fields Constructors Methods
net.sf.ehcache.hibernate.management.impl

public Class EhcacheHibernate

extends BaseEmitterBean
implements EhcacheHibernateMBean
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.hibernate.management.api.EhcacheHibernateMBean, net.sf.ehcache.hibernate.management.api.HibernateStats, javax.management.NotificationEmitter, javax.management.NotificationBroadcaster, net.sf.ehcache.hibernate.management.api.EhcacheStats
Imports
java.util.Map, java.util.concurrent.atomic.AtomicBoolean, javax.management.MBeanNotificationInfo, .NotCompliantMBeanException, .Notification, javax.management.openmbean.TabularData, net.sf.ehcache.CacheManager, net.sf.ehcache.hibernate.management.api.EhcacheHibernateMBean, .EhcacheStats, .HibernateStats, org.hibernate.SessionFactory

Implementation of the EhcacheHibernateMBean

Author
Abhishek Sanoujam

Field Summary

Modifier and TypeField and Description
private EhcacheStats
private volatile HibernateStats
private static final MBeanNotificationInfo
private final AtomicBoolean
Inherited from net.sf.ehcache.hibernate.management.impl.BaseEmitterBean:
emittersequenceNumber

Constructor Summary

AccessConstructor and Description
public
EhcacheHibernate(CacheManager
the backing CacheManager
manager
)

Constructor accepting the backing CacheManager

Method Summary

Modifier and TypeMethod and Description
public void
clearStats()

Implements net.sf.ehcache.hibernate.management.api.HibernateStats.clearStats.

Clears statistics, resets all counters to zero
public void
protected void
doDispose()

Implements abstract net.sf.ehcache.hibernate.management.impl.BaseEmitterBean.doDispose.

Dispose callback of subclasses
public void
enableHibernateStatistics(SessionFactory sessionFactory)

Enable hibernate statistics with the input session factory

public void
public void
flushRegionCache(String region)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.flushRegionCache.

Flushes the cache for the input region
public void
flushRegionCaches()

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.flushRegionCaches.

Flushes all the caches for all the regions
public String
public String
generateActiveConfigDeclaration(String region)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.generateActiveConfigDeclaration.

Returns the currently active cache configuration for the supplied region
public float
getAverageGetTimeMillis(String region)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getAverageGetTimeMillis.

Return average time taken in milliseconds for a get operation for the input cache name
public long
public double
public long
getCacheHitSample()

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getCacheHitSample.

Returns hit count sample for all the caches
public long
public double
public long
getCacheMissSample()

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getCacheMissSample.

Returns miss count sample for all the caches
public long
public double
public long
getCachePutSample()

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getCachePutSample.

Returns put count sample for all the caches
public TabularData
public long
public TabularData
public long
public TabularData
public long
public long
getMaxGetTimeMillis()

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getMaxGetTimeMillis.

Return maximum time taken in milliseconds for a get operation
public long
getMaxGetTimeMillis(String cacheName)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getMaxGetTimeMillis.

Return maximum time taken in milliseconds for a get operation for the input cache name
public long
getMinGetTimeMillis()

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getMinGetTimeMillis.

Return minimum time taken for a get operation in the cache in milliseconds
public long
getMinGetTimeMillis(String cacheName)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getMinGetTimeMillis.

Return minimum time taken in milliseconds for a get operation for the input cache name
public MBeanNotificationInfo[]
getNotificationInfo()

Implements abstract net.sf.ehcache.hibernate.management.impl.BaseEmitterBean.getNotificationInfo.

Implements javax.management.NotificationBroadcaster.getNotificationInfo.

Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.

public int
getNumberOfElementsInMemory(String region)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getNumberOfElementsInMemory.

Returns number of elements in-memory in the cache for the input region
public int
getNumberOfElementsOffHeap(String region)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getNumberOfElementsOffHeap.

Returns number of elements off-heap in the cache for the input region
public int
getNumberOfElementsOnDisk(String region)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getNumberOfElementsOnDisk.

Returns number of elements on-disk in the cache for the input region
public long
public String
public String
getOriginalConfigDeclaration(String
for which the configuration is required
region
)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getOriginalConfigDeclaration.

Returns the original cache configuration for the supplied region
public long
public long
public double
public long
getQueryExecutionSample()

Implements net.sf.ehcache.hibernate.management.api.HibernateStats.getQueryExecutionSample.

Returns last count sample of HQL's getting executed in the DB.
public TabularData
public Map<String, Map<String, Object>>
getRegionCacheAttributes()

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getRegionCacheAttributes.

Returns a map containing mapping of all cache region names to their attributes
public Map<String, Object>
getRegionCacheAttributes(String regionName)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getRegionCacheAttributes.

Returns a map containing attributes of the cache for the input cache region name
public int
public int
public int
getRegionCacheOrphanEvictionPeriod(String region)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getRegionCacheOrphanEvictionPeriod.

Returns the orphan eviction period for the input cache region.
public Map<String, int[]>
getRegionCacheSamples()

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.getRegionCacheSamples.

Returns a map containing mapping between cache names and an array containing hit, miss and put count samples
public int
public int
public long
public long
public long
public String[]
public long
public boolean
public boolean
isRegionCacheEnabled(String region)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.isRegionCacheEnabled.

Returns true if cache is enabled for the input region
public boolean
isRegionCacheLoggingEnabled(String region)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.isRegionCacheLoggingEnabled.

Returns true if logging is enabled for the input cache region
public boolean
isRegionCacheOrphanEvictionEnabled(String region)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.isRegionCacheOrphanEvictionEnabled.

Returns true if orphan eviction is enabled for the region otherwise false
public boolean
isRegionCachesEnabled()

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.isRegionCachesEnabled.

Returns true if all the cache regions are enabled.
public boolean
isStatisticsEnabled()

Implements net.sf.ehcache.hibernate.management.api.HibernateStats.isStatisticsEnabled.

Returns true if statistics collection is enabled otherwise false
public boolean
isTerracottaHibernateCache(String region)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.isTerracottaHibernateCache.

Returns true if the input region is clustered with terracotta
public void
setRegionCacheEnabled(String region, boolean enabled)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.setRegionCacheEnabled.

Enables/disables a particular region
public void
setRegionCacheLoggingEnabled(String region, boolean loggingEnabled)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.setRegionCacheLoggingEnabled.

Enable/Disable logging for the input cache region
public void
setRegionCacheMaxTTISeconds(String region, int
Returns the time to idle for the input cache region
maxTTISeconds
)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.setRegionCacheMaxTTISeconds.

Sets the time to idle for the input cache region
public void
setRegionCacheMaxTTLSeconds(String region, int maxTTLSeconds)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.setRegionCacheMaxTTLSeconds.

Sets the time to live for the input cache region
public void
setRegionCachesEnabled(boolean enabled)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.setRegionCachesEnabled.

Enable/disable all the cache regions.
public void
setRegionCacheTargetMaxInMemoryCount(String region, int targetMaxInMemoryCount)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.setRegionCacheTargetMaxInMemoryCount.

Sets the maxElementsInMemory of the input cache region
public void
setRegionCacheTargetMaxTotalCount(String region, int targetMaxTotalCount)

Implements net.sf.ehcache.hibernate.management.api.EhcacheStats.setRegionCacheTargetMaxTotalCount.

Sets the maxElementsOnDisk of the input cache region
public void
setStatisticsEnabled(boolean flag)

Implements net.sf.ehcache.hibernate.management.api.HibernateStats.setStatisticsEnabled.

Enable/Disable statistics collection
Inherited from net.sf.ehcache.hibernate.management.impl.BaseEmitterBean:
addNotificationListenerdisposeremoveNotificationListenerremoveNotificationListenersendNotificationsendNotificationsendNotification