KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > management > j2ee > statistics > JMSEndpointStatsImpl


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.management.j2ee.statistics;
23
24 import javax.management.j2ee.statistics.CountStatistic JavaDoc;
25 import javax.management.j2ee.statistics.JMSEndpointStats JavaDoc;
26 import javax.management.j2ee.statistics.TimeStatistic JavaDoc;
27
28 /**
29  * Represents a statistics provided by a JMS message producer or a
30  * JMS message consumer
31  *
32  * @author <a HREF="mailto:marc@jboss.org">Marc Fleury</a>
33  * @author Andreas Schaefer
34  * @version $Revision: 37459 $
35  */

36 public abstract class JMSEndpointStatsImpl extends StatsBase
37         implements JMSEndpointStats JavaDoc
38 {
39    // Constants -----------------------------------------------------
40

41    /** @since 4.0.2 */
42    private static final long serialVersionUID = -7305748957998405748L;
43    
44    // Attributes ----------------------------------------------------
45
private CountStatistic JavaDoc mMessageCount;
46    private CountStatistic JavaDoc mPendingMessageCount;
47    private CountStatistic JavaDoc mExpiredMessageCount;
48    private TimeStatistic JavaDoc mMessageWaitTime;
49
50    // Constructors --------------------------------------------------
51

52    public JMSEndpointStatsImpl(CountStatistic JavaDoc pMessageCount,
53                                CountStatistic JavaDoc pPendingMessageCount,
54                                CountStatistic JavaDoc pExpiredMessageCount,
55                                TimeStatistic JavaDoc pMessageWaitTime)
56    {
57       mMessageCount = pMessageCount;
58       super.addStatistic("MessageCount", mMessageCount);
59       mPendingMessageCount = pPendingMessageCount;
60       super.addStatistic("PendingMessageCount", mPendingMessageCount);
61       mExpiredMessageCount = pExpiredMessageCount;
62       super.addStatistic("ExpiredMessageCoun", mExpiredMessageCount);
63       mMessageWaitTime = pMessageWaitTime;
64       super.addStatistic("MessageWaitTime", mMessageWaitTime);
65    }
66
67    // Public --------------------------------------------------------
68

69    // javax.management.j2ee.JMSConnectionStats implementation -------
70

71    public CountStatistic JavaDoc getMessageCount()
72    {
73       return mMessageCount;
74    }
75
76    public CountStatistic JavaDoc getPendingMessageCount()
77    {
78       return mPendingMessageCount;
79    }
80
81    public CountStatistic JavaDoc getExpiredMessageCount()
82    {
83       return mExpiredMessageCount;
84    }
85
86    public TimeStatistic JavaDoc getMessageWaitTime()
87    {
88       return mMessageWaitTime;
89    }
90 }
91
Popular Tags