KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > management > JCAConnectionPoolStatsImpl


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.activemq.management;
19
20
21 /**
22  * Statistics for a JCA connection pool
23  *
24  * @version $Revision: 1.2 $
25  */

26 public class JCAConnectionPoolStatsImpl extends JCAConnectionStatsImpl {
27     private CountStatisticImpl closeCount;
28     private CountStatisticImpl createCount;
29     private BoundedRangeStatisticImpl freePoolSize;
30     private BoundedRangeStatisticImpl poolSize;
31     private RangeStatisticImpl waitingThreadCount;
32
33     public JCAConnectionPoolStatsImpl(String JavaDoc connectionFactory, String JavaDoc managedConnectionFactory, TimeStatisticImpl waitTime, TimeStatisticImpl useTime, CountStatisticImpl closeCount, CountStatisticImpl createCount, BoundedRangeStatisticImpl freePoolSize, BoundedRangeStatisticImpl poolSize, RangeStatisticImpl waitingThreadCount) {
34         super(connectionFactory, managedConnectionFactory, waitTime, useTime);
35         this.closeCount = closeCount;
36         this.createCount = createCount;
37         this.freePoolSize = freePoolSize;
38         this.poolSize = poolSize;
39         this.waitingThreadCount = waitingThreadCount;
40
41         // lets add named stats
42
addStatistic("freePoolSize", freePoolSize);
43         addStatistic("poolSize", poolSize);
44         addStatistic("waitingThreadCount", waitingThreadCount);
45     }
46
47     public CountStatisticImpl getCloseCount() {
48         return closeCount;
49     }
50
51     public CountStatisticImpl getCreateCount() {
52         return createCount;
53     }
54
55     public BoundedRangeStatisticImpl getFreePoolSize() {
56         return freePoolSize;
57     }
58
59     public BoundedRangeStatisticImpl getPoolSize() {
60         return poolSize;
61     }
62
63     public RangeStatisticImpl getWaitingThreadCount() {
64         return waitingThreadCount;
65     }
66
67 }
68
Popular Tags