1 22 package org.jboss.management.j2ee.statistics; 23 24 import javax.management.j2ee.statistics.CountStatistic ; 25 import javax.management.j2ee.statistics.JTAStats ; 26 27 33 public class JTAStatsImpl extends StatsBase 34 implements JTAStats 35 { 36 38 39 private static final long serialVersionUID = -8417543103749497467L; 40 41 43 public JTAStatsImpl() 44 { 45 this(new CountStatisticImpl("ActiveCount", "1", "The number of active transactions"), 46 new CountStatisticImpl("CommitedCount", "1", "The number of transactions committed"), 47 new CountStatisticImpl("RolledbackCount", "1", "The number of transactions rolled back")); 48 } 49 50 public JTAStatsImpl(CountStatistic activeCount, CountStatistic commitCount, 51 CountStatistic rollbackCount) 52 { 53 addStatistic("ActiveCount", activeCount); 54 addStatistic("CommitedCount", commitCount); 55 addStatistic("RolledbackCount", rollbackCount); 56 } 57 58 60 public CountStatistic getActiveCount() 61 { 62 CountStatisticImpl active = (CountStatisticImpl) getStatistic("ActiveCount"); 63 return active; 64 } 65 66 public CountStatistic getCommittedCount() 67 { 68 CountStatisticImpl active = (CountStatisticImpl) getStatistic("CommitedCount"); 69 return active; 70 } 71 72 public CountStatistic getRolledbackCount() 73 { 74 CountStatisticImpl active = (CountStatisticImpl) getStatistic("RolledbackCount"); 75 return active; 76 } 77 } 79 | Popular Tags |