CountStatisticImplpublic class CountStatisticImpl extends StatisticImpl implements javax.management.j2ee.statistics.CountStatisticAn implementation of a CountStatistic. All instances of this class are
immutable. Provides all the necessary accessors for properties. |
Fields Summary |
---|
private long | count | private static final com.sun.enterprise.util.i18n.StringManager | localStrMgr |
Constructors Summary |
---|
public CountStatisticImpl(String name)Constructs an instance of this class with following default values:
- Unit is empty string.
- Current Value is StatisticImpl#DEFAULT_VALUE.
- Description is calculated from the name passed in. This may well be read from a properties file to address i18n.
- LastSampleTime is time at the time of calling this method.
- StartTime is the same as LastSampleTime.
this(name, DEFAULT_UNIT);
| public CountStatisticImpl(String name, String unit)Constructs an instance of this class with following default values:
- Current Value is StatisticImpl#DEFAULT_VALUE.
- Description is calculated from the name passed in. This may well be read from a properties file to address i18n.
- LastSampleTime is time at the time of calling this method.
- StartTime is the same as LastSampleTime.
this(name, unit, DEFAULT_VALUE);
| public CountStatisticImpl(String name, String unit, String desc)Constructs an instance of this class with following default values:
- Description is calculated from the name passed in. This may well be read from a properties file to address i18n.
- LastSampleTime is time at the time of calling this method.
- StartTime is the same as LastSampleTime.
this(DEFAULT_VALUE, name, unit, desc, Util.getInitTime()[0], Util.getInitTime()[1]);
| public CountStatisticImpl(String name, String unit, long value)Constructs an instance of this class with following default values:
- Description is calculated from the name passed in. This may well be read from a properties file to address i18n.
- LastSampleTime is time at the time of calling this method.
- StartTime is the same as LastSampleTime.
this(value, name, unit, Util.getDescriptionFromName(name), Util.getInitTime()[0], Util.getInitTime()[1]);
| public CountStatisticImpl(long countVal, String name, String unit, String desc, long sampleTime, long startTime)Constructs an immutable instance of CountStatistic with given parameters.
super(name, unit, desc, startTime, sampleTime);
count = countVal;
|
Methods Summary |
---|
public long | getCount()Returns the current value of this statistic.
return count;
| public java.lang.String | toString()
return super.toString() + NEWLINE + "Count: " + getCount();
|
|