ch.elca.el4j.services.statistics.light
Class LightStatisticsReporter

java.lang.Object
  extended by ch.elca.el4j.services.statistics.light.LightStatisticsReporter
All Implemented Interfaces:
LightStatisticsReporterMBean, DisposableBean, InitializingBean

public class LightStatisticsReporter
extends Object
implements LightStatisticsReporterMBean, InitializingBean, DisposableBean

This class is a JMX proxy for JAMon performance measurements.

Author:
Andreas Bur (ABU)
File-location:
LightStatisticsReporter
Last check-in date:
2009-08-04 15:17:52 +0200 (Di, 04. Aug 2009) by swismer for revision 3880

Field Summary
static String NAME
          The address that points to this class.
 
Constructor Summary
LightStatisticsReporter()
           
 
Method Summary
 void afterPropertiesSet()
          
 void destroy()
          
 void disableMonitor()
          Disables the monitor preventing gathering measurements.
 void enableMonitor()
          Enables the monitor to gather measurements.
 String[] getData()
          Retrieves the performance measurements and returns a string representation.
 String getFormatString()
          
 MBeanServer getServer()
           
 boolean isFullyQualified()
          
protected  int[] prepareData(String[][] data)
          Converts class names, removes blank characters and computes the number of chars in the widest line.
 String report()
          Shows a Html report of the current data.
 void resetMonitor()
          Clears all the measured data.
 void setFormatString(String formatString)
          Sets the format string used to layout measurements.
 void setFullyQualified(boolean fullyQualified)
          Sets whether the class names should be shown in fully qualified representation.
 void setServer(MBeanServer beanServer)
          Sets the MBean server where this instance has to register.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
The address that points to this class.

See Also:
Constant Field Values
Constructor Detail

LightStatisticsReporter

public LightStatisticsReporter()
Method Detail

getFormatString

public String getFormatString()

Specified by:
getFormatString in interface LightStatisticsReporterMBean
Returns:
Returns the format string used to layout measurements.

setFormatString

public void setFormatString(String formatString)
Sets the format string used to layout measurements. The formatter is a MessageFormat instance.

Specified by:
setFormatString in interface LightStatisticsReporterMBean
Parameters:
formatString - The format string.
See Also:
MessageFormat

isFullyQualified

public boolean isFullyQualified()

Specified by:
isFullyQualified in interface LightStatisticsReporterMBean
Returns:
Returns true if class names are shown fully qualified.

setFullyQualified

public void setFullyQualified(boolean fullyQualified)
Sets whether the class names should be shown in fully qualified representation.

Specified by:
setFullyQualified in interface LightStatisticsReporterMBean
Parameters:
fullyQualified - true to show fully qualified class names.

getServer

public MBeanServer getServer()
Returns:
Retruns the MBean server instance where this instance is retistered in.

setServer

public void setServer(MBeanServer beanServer)
Sets the MBean server where this instance has to register.

Parameters:
beanServer - The MBean server to set.

resetMonitor

public void resetMonitor()
Clears all the measured data.

Specified by:
resetMonitor in interface LightStatisticsReporterMBean

enableMonitor

public void enableMonitor()
Enables the monitor to gather measurements.

Specified by:
enableMonitor in interface LightStatisticsReporterMBean

disableMonitor

public void disableMonitor()
Disables the monitor preventing gathering measurements.

Specified by:
disableMonitor in interface LightStatisticsReporterMBean

getData

public String[] getData()
Retrieves the performance measurements and returns a string representation. It's format can be changed through the LightStatisticsReporterMBean.setFormatString(String) method.

Specified by:
getData in interface LightStatisticsReporterMBean
Returns:
Returns the performance measurements.

prepareData

protected int[] prepareData(String[][] data)
Converts class names, removes blank characters and computes the number of chars in the widest line.

Parameters:
data - The measurement data.
Returns:
The number of chars in the widest row for each column of the data.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

destroy

public void destroy()
             throws Exception

Specified by:
destroy in interface DisposableBean
Throws:
Exception

report

public String report()
Shows a Html report of the current data.

Specified by:
report in interface LightStatisticsReporterMBean
Returns:
Data formatted as html.


Copyright © 2005-2011 ELCA. All Rights Reserved.