KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > resource > statistic > pool > JBossSubPoolStatistics


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.resource.statistic.pool;
23
24 import org.jboss.resource.statistic.JBossStatistics;
25
26 /**
27  * A SubPoolStatisticGroup.
28  *
29  * @author <a HREF="weston.price@jboss.com">Weston Price</a>
30  * @version $Revision: 44968 $
31  */

32 public class JBossSubPoolStatistics implements JBossStatistics
33 {
34
35    /** The serialVersionUID */
36    private static final long serialVersionUID = -5089686321382050654L;
37
38    /** The trackByTxn */
39    private Boolean JavaDoc trackByTxn;
40    
41    /** The availableConnections */
42    private long availableConnections;
43    
44    /** The maxConnectionsInUse */
45    private int maxConnectionsInUse;
46    
47    /** The connectionsInUse */
48    private int connectionsInUse;
49    
50    /** The connectionsDestroyed */
51    private int connectionsDestroyed;
52
53    /** The totalBlockTime */
54    private long totalBlockTime;
55    
56    /** The averageBlockTime */
57    private long averageBlockTime;
58    
59    /** The totalTimedOut */
60    private int totalTimedOut;
61    
62    /**
63     * Get the availableConnections.
64     *
65     * @return the availableConnections.
66     */

67    public long getAvailableConnections()
68    {
69       return availableConnections;
70    }
71
72
73    /**
74     * Set the availableConnections.
75     *
76     * @param availableConnections The availableConnections to set.
77     */

78    public void setAvailableConnections(long availableConnections)
79    {
80       this.availableConnections = availableConnections;
81    }
82
83
84    /**
85     * Get the connectionsDestroyed.
86     *
87     * @return the connectionsDestroyed.
88     */

89    public int getConnectionsDestroyed()
90    {
91       return connectionsDestroyed;
92    }
93
94
95    /**
96     * Set the connectionsDestroyed.
97     *
98     * @param connectionsDestroyed The connectionsDestroyed to set.
99     */

100    public void setConnectionsDestroyed(int connectionsDestroyed)
101    {
102       this.connectionsDestroyed = connectionsDestroyed;
103    }
104
105
106    /**
107     * Get the connectionsInUse.
108     *
109     * @return the connectionsInUse.
110     */

111    public int getConnectionsInUse()
112    {
113       return connectionsInUse;
114    }
115
116
117    /**
118     * Set the connectionsInUse.
119     *
120     * @param connectionsInUse The connectionsInUse to set.
121     */

122    public void setConnectionsInUse(int connectionsInUse)
123    {
124       this.connectionsInUse = connectionsInUse;
125    }
126
127
128    /**
129     * Get the maxConnectionsInUse.
130     *
131     * @return the maxConnectionsInUse.
132     */

133    public int getMaxConnectionsInUse()
134    {
135       return maxConnectionsInUse;
136    }
137
138
139    /**
140     * Set the maxConnectionsInUse.
141     *
142     * @param maxConnectionsInUse The maxConnectionsInUse to set.
143     */

144    public void setMaxConnectionsInUse(int maxConnectionsInUse)
145    {
146       this.maxConnectionsInUse = maxConnectionsInUse;
147    }
148
149
150    /**
151     * Get the trackByTxn.
152     *
153     * @return the trackByTxn.
154     */

155    public Boolean JavaDoc getTrackByTxn()
156    {
157       return trackByTxn;
158    }
159
160
161    /**
162     * Set the trackByTxn.
163     *
164     * @param trackByTxn The trackByTxn to set.
165     */

166    public void setTrackByTxn(Boolean JavaDoc trackByTxn)
167    {
168       this.trackByTxn = trackByTxn;
169    }
170
171
172    public String JavaDoc toString()
173    {
174       final StringBuffer JavaDoc statBuff = new StringBuffer JavaDoc();
175       statBuff.append("Track By Transaction: " + getTrackByTxn() + "\n");
176       statBuff.append("Available Connections Count: " + getAvailableConnections() + "\n");
177       statBuff.append("Max Connections In Use Count:" + getMaxConnectionsInUse() + "\n");
178       statBuff.append("Connections Destroyed Count:" + getConnectionsDestroyed() + "\n");
179       statBuff.append("Connections In Use Count:" + getConnectionsInUse() + "\n");
180       statBuff.append("Total Block Time:" + getTotalBlockTime() + "\n");
181       statBuff.append("Average Block Time For Sub Pool:" + getTotalBlockTime() + "\n");
182
183       statBuff.append("Total Timed Out:" + getTotalTimedOut() + "\n");
184
185       return statBuff.toString();
186    }
187
188
189    /**
190     * Get the totalBlockTime.
191     *
192     * @return the totalBlockTime.
193     */

194    public long getTotalBlockTime()
195    {
196       return totalBlockTime;
197    }
198
199
200    /**
201     * Set the totalBlockTime.
202     *
203     * @param totalBlockTime The totalBlockTime to set.
204     */

205    public void setTotalBlockTime(long totalBlockTime)
206    {
207       this.totalBlockTime = totalBlockTime;
208    }
209
210
211    /**
212     * Get the totalTimedOut.
213     *
214     * @return the totalTimedOut.
215     */

216    public int getTotalTimedOut()
217    {
218       return totalTimedOut;
219    }
220
221
222    /**
223     * Set the totalTimedOut.
224     *
225     * @param totalTimedOut The totalTimedOut to set.
226     */

227    public void setTotalTimedOut(int totalTimedOut)
228    {
229       this.totalTimedOut = totalTimedOut;
230    }
231
232
233    /**
234     * Get the averageBlockTime.
235     *
236     * @return the averageBlockTime.
237     */

238    public long getAverageBlockTime()
239    {
240       return averageBlockTime;
241    }
242
243
244    /**
245     * Set the averageBlockTime.
246     *
247     * @param averageBlockTime The averageBlockTime to set.
248     */

249    public void setAverageBlockTime(long averageBlockTime)
250    {
251       this.averageBlockTime = averageBlockTime;
252    }
253    
254 }
255
Popular Tags