org.jboss.cache.interceptors.base
Class JmxStatsCommandInterceptor

java.lang.Object
  extended by org.jboss.cache.commands.AbstractVisitor
      extended by org.jboss.cache.interceptors.base.CommandInterceptor
          extended by org.jboss.cache.interceptors.base.JmxStatsCommandInterceptor
All Implemented Interfaces:
Visitor, JmxStatisticsExposer
Direct Known Subclasses:
CacheLoaderInterceptor, CacheMgmtInterceptor, LegacyCacheLoaderInterceptor, PassivationInterceptor

public class JmxStatsCommandInterceptor
extends CommandInterceptor
implements JmxStatisticsExposer

Base class for all the interceptors exposing management statistics.

Since:
3.0
Author:
Mircea.Markus@jboss.com

Field Summary
 
Fields inherited from class org.jboss.cache.interceptors.base.CommandInterceptor
configuration, log, trace
 
Constructor Summary
JmxStatsCommandInterceptor()
           
 
Method Summary
 void checkStatisticsUsed()
           
 Map<String,Object> dumpStatistics()
          Returns a map of statistics.
 boolean getStatisticsEnabled()
          Returns whether an interceptor's statistics are being captured.
 void resetStatistics()
          Resets statistics gathered.
 void setStatisticsEnabled(boolean enabled)
          Enables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.
 
Methods inherited from class org.jboss.cache.interceptors.base.CommandInterceptor
getNext, handleDefault, hasNext, invokeNextInterceptor, setNext
 
Methods inherited from class org.jboss.cache.commands.AbstractVisitor
visitClearDataCommand, visitCollection, visitCommitCommand, visitCreateNodeCommand, visitEvictFqnCommand, visitExistsNodeCommand, visitGetChildrenNamesCommand, visitGetDataMapCommand, visitGetKeysCommand, visitGetKeyValueCommand, visitGetNodeCommand, visitGravitateDataCommand, visitInvalidateCommand, visitMoveCommand, visitOptimisticPrepareCommand, visitPrepareCommand, visitPutDataMapCommand, visitPutForExternalReadCommand, visitPutKeyValueCommand, visitRemoveKeyCommand, visitRemoveNodeCommand, visitRollbackCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmxStatsCommandInterceptor

public JmxStatsCommandInterceptor()
Method Detail

checkStatisticsUsed

public void checkStatisticsUsed()

getStatisticsEnabled

public boolean getStatisticsEnabled()
Returns whether an interceptor's statistics are being captured.

Specified by:
getStatisticsEnabled in interface JmxStatisticsExposer
Returns:
true if statistics are captured

setStatisticsEnabled

public void setStatisticsEnabled(boolean enabled)
Description copied from interface: JmxStatisticsExposer
Enables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.

Specified by:
setStatisticsEnabled in interface JmxStatisticsExposer
Parameters:
enabled - whether gathering statistics for JMX are enabled.

dumpStatistics

public Map<String,Object> dumpStatistics()
Returns a map of statistics. This is a default implementation which returns an empty map and should be overridden if it is to be meaningful.

Specified by:
dumpStatistics in interface JmxStatisticsExposer
Returns:
an empty map

resetStatistics

public void resetStatistics()
Resets statistics gathered. Is a no-op, and should be overridden if it is to be meaningful.

Specified by:
resetStatistics in interface JmxStatisticsExposer


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.