1 23 24 29 30 package com.sun.appserv.management.j2ee.statistics; 31 32 import java.util.Map ; 33 import java.io.Serializable ; 34 35 import javax.management.openmbean.CompositeData ; 36 import javax.management.j2ee.statistics.BoundedRangeStatistic ; 37 38 import com.sun.appserv.management.util.jmx.OpenMBeanUtil; 39 40 43 public class BoundedRangeStatisticImpl extends RangeStatisticImpl 44 implements BoundedRangeStatistic , Serializable 45 { 46 static final long serialVersionUID = 4803476800834526575L; 47 48 private long LowerBound; 49 private long UpperBound; 50 51 52 public 53 BoundedRangeStatisticImpl( 54 final String name, 55 final String description, 56 final String unit, 57 final long startTime, 58 final long lastSampleTime, 59 final long low, 60 final long current, 61 final long high, 62 final long lowerBound, 63 final long upperBound ) 64 { 65 super( name, description, unit, startTime, lastSampleTime, low, current, high ); 66 67 if ( lowerBound > upperBound ) 68 { 69 throw new IllegalArgumentException (); 70 } 71 72 LowerBound = lowerBound; 73 UpperBound = UpperBound; 74 } 75 76 public 77 BoundedRangeStatisticImpl( final CompositeData compositeData ) 78 { 79 this( OpenMBeanUtil.compositeDataToMap( compositeData ) ); 80 } 81 82 public 83 BoundedRangeStatisticImpl( final Map <String ,?> m ) 84 { 85 this( new MapStatisticImpl( m ) ); 86 } 87 88 public 89 BoundedRangeStatisticImpl( final MapStatistic s ) 90 { 91 super( s ); 92 93 LowerBound = s.getlong( "LowerBound" ); 94 UpperBound = s.getlong( "UpperBound" ); 95 } 96 97 public 98 BoundedRangeStatisticImpl( final BoundedRangeStatistic s ) 99 { 100 super( s ); 101 102 LowerBound = s.getLowerBound(); 103 UpperBound = s.getUpperBound(); 104 } 105 106 public long 107 getLowerBound() 108 { 109 return( LowerBound ); 110 } 111 112 public long 113 getUpperBound() 114 { 115 return( UpperBound ); 116 } 117 } 118 119 120 121 122 123 | Popular Tags |