1 23 24 package com.sun.ejb.base.stats; 25 26 import javax.management.j2ee.statistics.SessionBeanStats ; 27 import javax.management.j2ee.statistics.CountStatistic ; 28 import javax.management.j2ee.statistics.RangeStatistic ; 29 30 import com.sun.enterprise.admin.monitor.stats.CountStatisticImpl; 31 import com.sun.enterprise.admin.monitor.stats.MutableCountStatisticImpl; 32 import com.sun.enterprise.admin.monitor.stats.BoundedRangeStatisticImpl; 33 import com.sun.enterprise.admin.monitor.stats.MutableBoundedRangeStatisticImpl; 34 35 import com.sun.enterprise.admin.monitor.registry.MonitoringRegistry; 36 import com.sun.enterprise.admin.monitor.registry.MonitoringLevelListener; 37 import com.sun.enterprise.admin.monitor.registry.MonitoringLevel; 38 import com.sun.enterprise.admin.monitor.registry.MonitoringRegistrationException; 39 40 41 import com.sun.ejb.spi.stats.SessionBeanStatsProvider; 42 43 import java.util.logging.*; 44 import com.sun.enterprise.log.Log; 45 import com.sun.logging.*; 46 47 52 53 public abstract class SessionBeanStatsImpl 54 extends EJBStatsImpl 55 implements javax.management.j2ee.statistics.SessionBeanStats 56 { 57 protected SessionBeanStatsProvider sessionDelegate; 58 59 private MutableBoundedRangeStatisticImpl methodReadyCountStat; 60 61 public SessionBeanStatsImpl(SessionBeanStatsProvider delegate, String intfName) { 62 super(delegate, intfName); 63 this.sessionDelegate = delegate; 64 } 65 66 protected void initSessionStats() { 67 methodReadyCountStat = new MutableBoundedRangeStatisticImpl( 68 new BoundedRangeStatisticImpl("MethodReadyCount", 69 "Count", 0, getMaxReadyCount(), getMinReadyCount())); 70 } 71 72 public RangeStatistic getMethodReadyCount() { 73 methodReadyCountStat.setCount(sessionDelegate.getMethodReadyCount()); 74 return (RangeStatistic ) methodReadyCountStat.modifiableView(); 75 } 76 77 protected abstract int getMaxReadyCount(); 78 79 protected abstract int getMinReadyCount(); 80 } 81 | Popular Tags |