Class CountStatisticImpl
- java.lang.Object
-
- com.sun.enterprise.admin.monitor.stats.StatisticImpl
-
- com.sun.enterprise.admin.monitor.stats.CountStatisticImpl
-
- All Implemented Interfaces:
Serializable
,CountStatistic
,Statistic
public class CountStatisticImpl extends StatisticImpl implements CountStatistic
An implementation of a CountStatistic. All instances of this class are immutable. Provides all the necessary accessors for properties.- Since:
- S1AS8.0
- Author:
- Muralidhar Vempaty, Kedar Mhaswade
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.sun.enterprise.admin.monitor.stats.StatisticImpl
DEFAULT_UNIT, DEFAULT_VALUE, NEWLINE
-
-
Constructor Summary
Constructors Constructor Description CountStatisticImpl(long countVal, String name, String unit, String desc, long sampleTime, long startTime)
Constructs an immutable instance of CountStatistic with given parameters.CountStatisticImpl(String name)
Constructs an instance of this class with following default values: Unit is empty string.CountStatisticImpl(String name, String unit)
Constructs an instance of this class with following default values: Current Value is StatisticImpl#DEFAULT_VALUE.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.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCount()
Returns the current value of this statistic.String
toString()
-
Methods inherited from class com.sun.enterprise.admin.monitor.stats.StatisticImpl
getDescription, getLastSampleTime, getName, getStartTime, getUnit, setDescription
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.glassfish.j2ee.statistics.Statistic
getDescription, getLastSampleTime, getName, getStartTime, getUnit
-
-
-
-
Constructor Detail
-
CountStatisticImpl
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.
- Parameters:
name
- String indicating the name of the statistic
-
CountStatisticImpl
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.
- Parameters:
name
- String indicating the name of the statisticunit
- String indicating the unit of the statistic
-
CountStatisticImpl
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.
- Parameters:
name
- String indicating the name of the statisticunit
- String indicating the unit of the statisticdesc
- A brief description of the statistic
-
CountStatisticImpl
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.
- Parameters:
name
- String indicating the name of the statisticunit
- String indicating the unit of the statisticvalue
- long indicating the unit of the statistic
-
CountStatisticImpl
public CountStatisticImpl(long countVal, String name, String unit, String desc, long sampleTime, long startTime)
Constructs an immutable instance of CountStatistic with given parameters.- Parameters:
curVal
- The current value of this statisticname
- The name of the statisticunit
- The unit of measurement for this statisticdesc
- A brief description of the statisticstartTime
- Time in milliseconds at which the measurement was startedsampleTime
- Time at which the last measurement was done.
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toString
in classStatisticImpl
-
getCount
public long getCount()
Returns the current value of this statistic.- Specified by:
getCount
in interfaceCountStatistic
- Returns:
- long indicating current value
-
-