1 22 package org.jboss.management.j2ee.statistics; 23 24 import javax.management.j2ee.statistics.CountStatistic ; 25 import javax.management.j2ee.statistics.JMSConsumerStats ; 26 import javax.management.j2ee.statistics.JMSProducerStats ; 27 import javax.management.j2ee.statistics.JMSSessionStats ; 28 import javax.management.j2ee.statistics.TimeStatistic ; 29 30 31 38 public final class JMSSessionStatsImpl extends StatsBase 39 implements JMSSessionStats 40 { 41 43 44 private static final long serialVersionUID = 7614059976793609889L; 45 46 private JMSProducerStats [] mProducers; 48 private JMSConsumerStats [] mConsumers; 49 private CountStatistic mMessageCount; 50 private CountStatistic mPendingMessageCount; 51 private CountStatistic mExpiredMessageCount; 52 private TimeStatistic mMessageWaitTime; 53 private CountStatistic mDurableSubscriptionCount; 54 55 57 public JMSSessionStatsImpl(JMSProducerStats [] pProducers, 58 JMSConsumerStats [] pConsumers, 59 CountStatistic pMessageCount, 60 CountStatistic pPendingMessageCount, 61 CountStatistic pExpiredMessageCount, 62 TimeStatistic pMessageWaitTime, 63 CountStatistic pDurableSubscriptionCount) 64 { 65 mProducers = (pProducers != null ? pProducers : new JMSProducerStats [0]); 66 mConsumers = (pConsumers != null ? pConsumers : new JMSConsumerStats [0]); 67 mMessageCount = pMessageCount; 68 super.addStatistic("MessageCount", mMessageCount); 69 mPendingMessageCount = pPendingMessageCount; 70 super.addStatistic("PendingMessageCount", mPendingMessageCount); 71 mExpiredMessageCount = pExpiredMessageCount; 72 super.addStatistic("ExpiredMessageCount", mExpiredMessageCount); 73 mMessageWaitTime = pMessageWaitTime; 74 super.addStatistic("MessageWaitTime", mMessageWaitTime); 75 mDurableSubscriptionCount = pDurableSubscriptionCount; 76 super.addStatistic("DurableSubscriptionCount", mDurableSubscriptionCount); 77 } 78 79 81 83 public JMSProducerStats [] getProducers() 84 { 85 return mProducers; 86 } 87 88 public JMSConsumerStats [] getConsumers() 89 { 90 return mConsumers; 91 } 92 93 public CountStatistic getMessageCount() 94 { 95 return mMessageCount; 96 } 97 98 public CountStatistic getPendingMessageCount() 99 { 100 return mPendingMessageCount; 101 } 102 103 public CountStatistic getExpiredMessageCount() 104 { 105 return mExpiredMessageCount; 106 } 107 108 public TimeStatistic getMessageWaitTime() 109 { 110 return mMessageWaitTime; 111 } 112 113 public CountStatistic getDurableSubscriptionCount() 114 { 115 return mDurableSubscriptionCount; 116 } 117 } 118 | Popular Tags |