1 23 24 package com.sun.ejb.base.stats; 25 26 import javax.management.j2ee.statistics.CountStatistic ; 27 import javax.management.j2ee.statistics.EJBStats ; 28 29 import com.sun.enterprise.admin.monitor.stats.CountStatisticImpl; 30 import com.sun.enterprise.admin.monitor.stats.MutableCountStatisticImpl; 31 32 import com.sun.ejb.spi.stats.EJBStatsProvider; 33 34 40 41 public abstract class EJBStatsImpl 42 extends StatsImpl 43 implements javax.management.j2ee.statistics.EJBStats 44 { 45 protected EJBStatsProvider delegate; 46 47 private MutableCountStatisticImpl createStat; 48 private MutableCountStatisticImpl removeStat; 49 50 public EJBStatsImpl(EJBStatsProvider delegate, String intfName) { 51 this.delegate = delegate; 52 super.initialize(intfName); 53 54 initStats(); 55 } 56 57 private void initStats() { 58 createStat = new MutableCountStatisticImpl( 59 new CountStatisticImpl("CreateCount")); 60 removeStat = new MutableCountStatisticImpl( 61 new CountStatisticImpl("RemoveCount")); 62 } 63 64 public CountStatistic getCreateCount(){ 65 createStat.setCount(delegate.getCreateCount()); 66 return (CountStatistic ) createStat.modifiableView(); 67 } 68 69 public CountStatistic getRemoveCount(){ 70 removeStat.setCount(delegate.getRemoveCount()); 71 return (CountStatistic ) removeStat.modifiableView(); 72 } 73 74 } 75 | Popular Tags |