1 23 24 26 27 package com.sun.enterprise.management.monitor; 28 29 import java.util.Map ; 30 31 import com.sun.appserv.management.base.XTypes; 32 import com.sun.enterprise.management.support.Delegate; 33 34 import com.sun.appserv.management.monitor.statistics.AltServletStats; 35 36 import javax.management.j2ee.statistics.Statistic ; 37 import javax.management.j2ee.statistics.TimeStatistic ; 38 import javax.management.j2ee.statistics.CountStatistic ; 39 40 import com.sun.appserv.management.util.misc.ArrayUtil; 41 import com.sun.appserv.management.util.j2ee.J2EEUtil; 42 43 import com.sun.appserv.management.j2ee.statistics.TimeStatisticImpl; 44 import com.sun.appserv.management.j2ee.statistics.CountStatisticImpl; 45 46 47 public class ServletMonitorImpl 48 extends MonitoringStatsImplBase 49 { 51 public 52 ServletMonitorImpl(Delegate delegate) 53 { 54 super( XTypes.SERVLET_MONITOR, delegate ); 55 } 56 57 protected Class 58 getStatsInterface() 59 { 60 return( AltServletStats.class ); 61 } 62 63 public AltServletStats 64 getAltServletStats() 65 { 66 return( (AltServletStats)getStats() ); 67 } 68 69 70 78 protected final Statistic [] 79 getStatisticsFromDelegate( final Delegate d) 80 { 81 final Statistic [] fromSuper = super.getStatisticsFromDelegate( d ); 82 83 final Map <String ,Statistic > m = J2EEUtil.statisticsToMap( fromSuper ); 84 85 final Statistic [] result = new Statistic [ 6 ]; 86 87 result[ 0 ] = (Statistic )m.get( "ServiceTime" ); result[ 1 ] = (Statistic )m.get( "ErrorCount" ); result[ 2 ] = (Statistic )m.get( "RequestCount" ); result[ 3 ] = (Statistic )m.get( "ProcessingTime" ); result[ 4 ] = (Statistic )m.get( "MaxTime" ); result[ 5 ] = (Statistic )m.get( "ServiceTime" ); 94 return result; 95 } 96 97 98 99 100 } 101 | Popular Tags |