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 37 import javax.management.j2ee.statistics.TimeStatistic ; 38 39 import com.sun.appserv.management.util.jmx.OpenMBeanUtil; 40 41 42 45 public final class TimeStatisticImpl 46 extends StatisticImpl implements TimeStatistic , Serializable 47 { 48 static final long serialVersionUID = 1090185734375468511L; 49 50 51 private final long Count; 52 private final long MinTime; 53 private final long MaxTime; 54 private final long TotalTime; 55 56 public 57 TimeStatisticImpl( final CompositeData compositeData ) 58 { 59 this( OpenMBeanUtil.compositeDataToMap( compositeData ) ); 60 } 61 62 public 63 TimeStatisticImpl( final Map <String ,?> m ) 64 { 65 this( new MapStatisticImpl( m ) ); 66 } 67 68 public 69 TimeStatisticImpl( final TimeStatistic s ) 70 { 71 super( s ); 72 73 Count = s.getCount(); 74 MinTime = s.getMinTime(); 75 MaxTime = s.getMaxTime(); 76 TotalTime = s.getTotalTime(); 77 } 78 79 public 80 TimeStatisticImpl( final MapStatistic s ) 81 { 82 super( s ); 83 84 Count = s.getlong( "Count" ); 85 MinTime = s.getlong( "MinTime" ); 86 MaxTime = s.getlong( "MaxTime" ); 87 TotalTime = s.getlong( "TotalTime" ); 88 } 89 90 public 91 TimeStatisticImpl( 92 final String name, 93 final String description, 94 final String unit, 95 final long startTime, 96 final long lastSampleTime, 97 final long count, 98 final long maxTime, 99 final long minTime, 100 final long totalTime ) 101 { 102 super( name, description, unit, startTime, lastSampleTime ); 103 Count = count; 104 MaxTime = maxTime; 105 MinTime = minTime; 106 TotalTime = totalTime; 107 } 108 109 110 public long 111 getCount() 112 { 113 return( Count ); 114 } 115 116 public long 117 getMaxTime() 118 { 119 return( MaxTime ); 120 } 121 122 public long 123 getMinTime() 124 { 125 return( MinTime ); 126 } 127 128 public long 129 getTotalTime() 130 { 131 return( TotalTime ); 132 } 133 } 134 135 136 137 138 139 | Popular Tags |