ehcache

net.sf.ehcache.hibernate.management.impl
Class HibernateStatsImpl

java.lang.Object
  extended by javax.management.StandardMBean
      extended by net.sf.ehcache.hibernate.management.impl.BaseEmitterBean
          extended by net.sf.ehcache.hibernate.management.impl.HibernateStatsImpl
All Implemented Interfaces:
DynamicMBean, MBeanRegistration, NotificationBroadcaster, NotificationEmitter, HibernateStats

public class HibernateStatsImpl
extends BaseEmitterBean
implements HibernateStats

Implementation of HibernateStats

Author:
Abhishek Sanoujam

Field Summary
 
Fields inherited from class net.sf.ehcache.hibernate.management.impl.BaseEmitterBean
emitter, sequenceNumber
 
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
HibernateStatsImpl(SessionFactory sessionFactory)
          Constructor accepting the backing SessionFactory
 
Method Summary
 void clearStats()
          Clears statistics, resets all counters to zero
 void disableStats()
          Disables statistics collection
protected  void doDispose()
          Dispose callback of subclasses
 void enableStats()
          Enables statistics collection
 TabularData getCacheRegionStats()
          Returns TabularData of cache region stats
 long getCloseStatementCount()
          Returns the count of close statements
 TabularData getCollectionStats()
          Returns TabularData of collection stats
 long getConnectCount()
          Return connect counts
 long getDBSQLExecutionSample()
          Not supported right now
 TabularData getEntityStats()
          Returns TabularData of entity stats
 long getFlushCount()
          Returns flush count
 MBeanNotificationInfo[] getNotificationInfo()
           
 long getOptimisticFailureCount()
          Returns Optimistic failure count
 long getPrepareStatementCount()
          Returns prepare statement count
 long getQueryExecutionCount()
          Returns the query execution count.
 double getQueryExecutionRate()
          Returns rate of HQL query executed in the DB
 long getQueryExecutionSample()
          Returns last count sample of HQL's getting executed in the DB.
 TabularData getQueryStats()
          Returns TabularData of query stats
 long getSessionCloseCount()
          Returns session close count
 long getSessionOpenCount()
          Returns session open count
 long getSuccessfulTransactionCount()
          Returns successful transaction count
 long getTransactionCount()
          Returns transaction count
 boolean isStatisticsEnabled()
          Returns true if statistics collection is enabled otherwise false
 void setStatisticsEnabled(boolean flag)
          Enable/Disable statistics collection
 
Methods inherited from class net.sf.ehcache.hibernate.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

HibernateStatsImpl

public HibernateStatsImpl(SessionFactory sessionFactory)
                   throws NotCompliantMBeanException
Constructor accepting the backing SessionFactory

Parameters:
sessionFactory -
Throws:
NotCompliantMBeanException
Method Detail

clearStats

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

Specified by:
clearStats in interface HibernateStats
See Also:
HibernateStats.clearStats()

disableStats

public void disableStats()
Disables statistics collection

Specified by:
disableStats in interface HibernateStats
See Also:
HibernateStats.disableStats()

enableStats

public void enableStats()
Enables statistics collection

Specified by:
enableStats in interface HibernateStats
See Also:
HibernateStats.enableStats()

getCloseStatementCount

public long getCloseStatementCount()
Returns the count of close statements

Specified by:
getCloseStatementCount in interface HibernateStats
Returns:
Returns the count of close statementss
See Also:
HibernateStats.getCloseStatementCount()

getConnectCount

public long getConnectCount()
Return connect counts

Specified by:
getConnectCount in interface HibernateStats
Returns:
Return connect counts
See Also:
HibernateStats.getConnectCount()

getDBSQLExecutionSample

public long getDBSQLExecutionSample()
Not supported right now


getFlushCount

public long getFlushCount()
Returns flush count

Specified by:
getFlushCount in interface HibernateStats
Returns:
Returns flush count
See Also:
HibernateStats.getFlushCount()

getOptimisticFailureCount

public long getOptimisticFailureCount()
Returns Optimistic failure count

Specified by:
getOptimisticFailureCount in interface HibernateStats
Returns:
Returns Optimistic failure count
See Also:
HibernateStats.getOptimisticFailureCount()

getPrepareStatementCount

public long getPrepareStatementCount()
Returns prepare statement count

Specified by:
getPrepareStatementCount in interface HibernateStats
Returns:
Returns prepare statement count
See Also:
HibernateStats.getPrepareStatementCount()

getQueryExecutionCount

public long getQueryExecutionCount()
Returns the query execution count. This includes only HQL's

Specified by:
getQueryExecutionCount in interface HibernateStats
Returns:
Returns the query execution count. This includes only HQL's
See Also:
HibernateStats.getQueryExecutionCount()

getQueryExecutionRate

public double getQueryExecutionRate()
Returns rate of HQL query executed in the DB

Specified by:
getQueryExecutionRate in interface HibernateStats
Returns:
Returns rate of HQL query executed in the DB
See Also:
HibernateStats.getQueryExecutionRate()

getQueryExecutionSample

public long getQueryExecutionSample()
Returns last count sample of HQL's getting executed in the DB.

Specified by:
getQueryExecutionSample in interface HibernateStats
Returns:
Returns last count sample of HQL's getting executed in the DB.
See Also:
HibernateStats.getQueryExecutionSample()

getSessionCloseCount

public long getSessionCloseCount()
Returns session close count

Specified by:
getSessionCloseCount in interface HibernateStats
Returns:
Returns session close count
See Also:
HibernateStats.getSessionCloseCount()

getSessionOpenCount

public long getSessionOpenCount()
Returns session open count

Specified by:
getSessionOpenCount in interface HibernateStats
Returns:
Returns session open count
See Also:
HibernateStats.getSessionOpenCount()

getSuccessfulTransactionCount

public long getSuccessfulTransactionCount()
Returns successful transaction count

Specified by:
getSuccessfulTransactionCount in interface HibernateStats
Returns:
Returns successful transaction count
See Also:
HibernateStats.getSuccessfulTransactionCount()

getTransactionCount

public long getTransactionCount()
Returns transaction count

Specified by:
getTransactionCount in interface HibernateStats
Returns:
Returns transaction count
See Also:
HibernateStats.getTransactionCount()

isStatisticsEnabled

public boolean isStatisticsEnabled()
Returns true if statistics collection is enabled otherwise false

Specified by:
isStatisticsEnabled in interface HibernateStats
Returns:
Returns true if statistics collection is enabled otherwise false
See Also:
HibernateStats.isStatisticsEnabled()

setStatisticsEnabled

public void setStatisticsEnabled(boolean flag)
Enable/Disable statistics collection

Specified by:
setStatisticsEnabled in interface HibernateStats
See Also:
HibernateStats.setStatisticsEnabled(boolean)

getEntityStats

public TabularData getEntityStats()
Returns TabularData of entity stats

Specified by:
getEntityStats in interface HibernateStats
Returns:
Returns TabularData of entity stats
See Also:
HibernateStats.getEntityStats()

getCollectionStats

public TabularData getCollectionStats()
Returns TabularData of collection stats

Specified by:
getCollectionStats in interface HibernateStats
Returns:
Returns TabularData of collection stats
See Also:
HibernateStats.getCollectionStats()

getQueryStats

public TabularData getQueryStats()
Returns TabularData of query stats

Specified by:
getQueryStats in interface HibernateStats
Returns:
Returns TabularData of query stats
See Also:
HibernateStats.getQueryStats()

getCacheRegionStats

public TabularData getCacheRegionStats()
Returns TabularData of cache region stats

Specified by:
getCacheRegionStats in interface HibernateStats
Returns:
Returns TabularData of cache region stats

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

ehcache

Copyright 2001-2014, Terracotta, Inc.