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.BoundaryStatistic ; 37 38 import com.sun.appserv.management.util.jmx.OpenMBeanUtil; 39 40 43 public class BoundaryStatisticImpl extends StatisticImpl 44 implements BoundaryStatistic , Serializable 45 { 46 static final long serialVersionUID = -5190567251179453418L; 47 48 private long LowerBound; 49 private long UpperBound; 50 51 52 public 53 BoundaryStatisticImpl( 54 final String name, 55 final String description, 56 final String unit, 57 final long startTime, 58 final long lastSampleTime, 59 final long lower, 60 final long upper ) 61 { 62 super( name, description, unit, startTime, lastSampleTime ); 63 64 if ( LowerBound > UpperBound ) 65 { 66 throw new IllegalArgumentException (); 67 } 68 69 LowerBound = lower; 70 UpperBound = upper; 71 } 72 73 76 public 77 BoundaryStatisticImpl( final CompositeData compositeData ) 78 { 79 this( OpenMBeanUtil.compositeDataToMap( compositeData ) ); 80 } 81 82 public 83 BoundaryStatisticImpl( final Map <String ,?> m ) 84 { 85 this( new MapStatisticImpl( m ) ); 86 } 87 88 89 public 90 BoundaryStatisticImpl( final MapStatistic s ) 91 { 92 super( s ); 93 94 LowerBound = s.getlong( "LowerBound" ); 95 UpperBound = s.getlong( "UpperBound" ); 96 } 97 98 public 99 BoundaryStatisticImpl( final BoundaryStatistic s ) 100 { 101 super( s ); 102 103 LowerBound = s.getLowerBound(); 104 UpperBound = s.getUpperBound(); 105 } 106 107 public long 108 getLowerBound() 109 { 110 return( LowerBound ); 111 } 112 113 public long 114 getUpperBound() 115 { 116 return( UpperBound ); 117 } 118 } 119 120 121 122 123 124 | Popular Tags |