FileDocCategorySizeDatePackage
StatisticImpl.javaAPI DocGlassfish v2 API5332Fri May 04 22:25:48 BST 2007com.sun.enterprise.admin.monitor.stats

StatisticImpl

public abstract class StatisticImpl extends Object implements Serializable, javax.management.j2ee.statistics.Statistic
An abstract class providing implementation of the Statistic interface The intent is for this to be subclassed by all the StatisticImpls.
author
Muralidhar Vempaty
since
S1AS8.0
version
1.0

Fields Summary
private String
statisticName
private String
statisticDesc
private String
statisticUnit
private long
startTime
private long
sampleTime
public static final String
DEFAULT_UNIT
DEFAULT_UNIT is an empty string
public static final com.sun.enterprise.util.i18n.StringManager
localStrMgr
public static final long
DEFAULT_VALUE
DEFAULT_VALUE of any statistic is 0
protected static final String
NEWLINE
Constructors Summary
protected StatisticImpl(String name, String unit, String desc, long start_time, long sample_time)
Constructor

param
name The name of the statistic
param
unit The unit of measurement for this statistic
param
desc A brief description of the statistic
param
startTime Time in milliseconds at which the measurement was started
param
sampleTime Time at which the last measurement was done.

                                                                       
           
                              
        
        statisticName = name;
        statisticUnit = unit;
        statisticDesc = desc;
        startTime = start_time;
        sampleTime = sample_time;
    
Methods Summary
public java.lang.StringgetDescription()
returns the description of the statistic

        return this.statisticDesc;
    
public longgetLastSampleTime()
returns the time in millis, at which the last measurement was taken

        return this.sampleTime;
    
public java.lang.StringgetName()
returns the name of the statistic

        return this.statisticName;
    
public longgetStartTime()
returns the time in millis, at which the first measurement was taken

        return this.startTime;
    
public java.lang.StringgetUnit()
returns the unit of measurement for the statistic

        return this.statisticUnit;
    
public voidsetDescription(java.lang.String desc)
This is a hack. This method allows us to internatinalize the descriptions. See bug Id: 5045413

        this.statisticDesc = desc;
    
public java.lang.StringtoString()

        return "Statistic " + getClass().getName() + NEWLINE +
            "Name: " + getName() + NEWLINE +
            "Description: " + getDescription() + NEWLINE +
            "Unit: " + getUnit() + NEWLINE +
            "LastSampleTime: " + getLastSampleTime() + NEWLINE +
            "StartTime: " + getStartTime();