BoundedRangeStatisticImplpublic final class BoundedRangeStatisticImpl extends StatisticImpl implements javax.management.j2ee.statistics.BoundedRangeStatisticAn implementation of a BoundedRangeStatistic. All instances of this class are
immutable. Provides all the necessary accessors for properties. |
Fields Summary |
---|
private final long | currentVal | private final long | highWaterMark | private final long | lowWaterMark | private final long | upperBound | private final long | lowerBound | private static final com.sun.enterprise.util.i18n.StringManager | localStrMgr | public static final long | DEFAULT_MAX_BOUNDDEFAULT_UPPER_BOUND is maximum value Long can attain | public static final long | DEFAULT_MIN_BOUNDDEFAULT_LOWER_BOUND is same as DEFAULT_VALUE i.e. 0 |
Constructors Summary |
---|
public BoundedRangeStatisticImpl(String name)A constructor that creates an instance of class. Following are the defaults:
- Unit is defaulted to empty string.
- 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.
- Current Value is initialized to StatisticImpl#DEFAULT_VALUE.
- UpperBound is initialized to StatisticImpl#DEFAULT_MAX_BOUND.
- LowerBound is initialized to StatisticImpl#DEFAULT_MIN_BOUND.
- HighWaterMark is initialized to Current Value.
- LowWaterMark is initialized to Current Value.
this(name, DEFAULT_UNIT);
| public BoundedRangeStatisticImpl(String name, String unit)A constructor that creates an instance of class. Following are the defaults:
- 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.
- Current Value is initialized to StatisticImpl#DEFAULT_VALUE.
- UpperBound is initialized to StatisticImpl#DEFAULT_MAX_BOUND.
- LowerBound is initialized to StatisticImpl#DEFAULT_MIN_BOUND.
- HighWaterMark is initialized to Current Value.
- LowWaterMark is initialized to Current Value.
this(name, unit, DEFAULT_VALUE);
| public BoundedRangeStatisticImpl(String name, String unit, String desc, long value, long max, long min)A constructor that creates an instance of class. Following are the defaults:
- 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.
- UpperBound is initialized to StatisticImpl#DEFAULT_MAX_BOUND.
- LowerBound is initialized to StatisticImpl#DEFAULT_MIN_BOUND.
- HighWaterMark is initialized to Current Value.
- LowWaterMark is initialized to Current Value.
this (value,
value,
value,
max,
min,
name,
unit,
desc,
Util.getInitTime()[0],
Util.getInitTime()[1]
);
| public BoundedRangeStatisticImpl(String name, String unit, long value)A constructor that creates an instance of class. Following are the defaults:
- LastSampleTime is time at the time of calling this method.
- StartTime is the same as LastSampleTime.
- UpperBound is initialized to StatisticImpl#DEFAULT_MAX_BOUND.
- LowerBound is initialized to StatisticImpl#DEFAULT_MIN_BOUND.
- HighWaterMark is initialized to Current Value.
- LowWaterMark is initialized to Current Value.
this(name, unit, value, DEFAULT_MAX_BOUND, DEFAULT_MIN_BOUND);
| public BoundedRangeStatisticImpl(String name, String unit, long value, long max, long min)A constructor that creates an instance of class. Following are the defaults:
- 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.
- HighWaterMark is initialized to Current Value.
- LowWaterMark is initialized to Current Value.
this(name, unit, value, max, min, value, value);
| public BoundedRangeStatisticImpl(String name, String unit, long value, long max, long min, long highMark, long lowMark)A constructor that creates an instance of class. Following are the defaults:
- 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,
highMark,
lowMark,
max,
min,
name,
unit,
Util.getDescriptionFromName(name),
Util.getInitTime()[0],
Util.getInitTime()[1]
);
| public BoundedRangeStatisticImpl(long curVal, long highMark, long lowMark, long upper, long lower, String name, String unit, String desc, long startTime, long sampleTime)Constructs an immutable instance of BoundedRangeStatisticImpl.
super(name, unit, desc, startTime, sampleTime);
currentVal = curVal;
highWaterMark = highMark;
lowWaterMark = lowMark;
upperBound = upper;
lowerBound = lower;
|
Methods Summary |
---|
public long | getCurrent()Returns the current value of this statistic.
return currentVal;
| public long | getHighWaterMark()Returns the highest value of this statistic, since measurement started.
return highWaterMark;
| public long | getLowWaterMark()Returns the lowest value of this statistic, since measurement started.
return lowWaterMark;
| public long | getLowerBound()Return the lowest possible value, that this statistic is permitted to attain.
return lowerBound;
| public long | getUpperBound()Returns the highest possible value, that this statistic is permitted to attain.
return upperBound;
| public java.lang.String | toString()
return super.toString() + NEWLINE +
"Current: " + getCurrent() + NEWLINE +
"LowWaterMark: " + getLowWaterMark() + NEWLINE +
"HighWaterMark: " + getHighWaterMark() + NEWLINE +
"LowerBound: " + getLowerBound() + NEWLINE +
"UpperBound: " + getUpperBound();
|
|