KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > resource > connectionmanager > JBossManagedConnectionPoolMBean


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.connectionmanager;
23
24 /**
25  * Management interface for JBossManagedConnectionPool.
26  *
27  * @author <a HREF="mailto:weston.price@jboss.com">Weston Price</a>
28  *
29  * @version $Revision: 57098 $
30  */

31 public interface JBossManagedConnectionPoolMBean extends org.jboss.system.ServiceMBean {
32
33    //default object name
34
public static final javax.management.ObjectName JavaDoc OBJECT_NAME = org.jboss.mx.util.ObjectNameFactory.create("jboss.jca:service=JBossManagedConnectionPool");
35
36    /**
37     * ManagedConnectionPool is a read only attribute returning the pool set up by this mbean.
38     * @return the ManagedConnectionPool implementing the pool configured by this mbean.
39     */

40   org.jboss.resource.connectionmanager.ManagedConnectionPool getManagedConnectionPool() ;
41
42    /**
43     * ManagedConnectionFactoryName holds the ObjectName of the mbean that represents the ManagedConnectionFactory. Normally this can be an embedded mbean in a depends element rather than a separate mbean reference.
44     * @return the ManagedConnectionFactoryName value.
45     */

46   javax.management.ObjectName JavaDoc getManagedConnectionFactoryName() ;
47
48    /**
49     * Set the ManagedConnectionFactoryName value.
50     * @param newManagedConnectionFactoryName The new ManagedConnectionFactoryName value.
51     */

52   void setManagedConnectionFactoryName(javax.management.ObjectName JavaDoc newManagedConnectionFactoryName) ;
53
54    /**
55     * Get number of available free connections
56     * @return number of available connections
57     */

58   long getAvailableConnectionCount() ;
59
60   /**
61     * Get the maximum number of connections that were in use at any point in time.
62     *
63     * @return number of maximum connections in use.
64     */

65    long getMaxConnectionsInUseCount();
66
67    /**
68     * Get number of connections currently in use
69     * @return number of connections currently in use
70     */

71   long getInUseConnectionCount() ;
72
73    /**
74     * The MinSize attribute indicates the minimum number of connections this pool should hold. These are not created until a Subject is known from a request for a connection. MinSize connections will be created for each sub-pool.
75     * @return the MinSize value.
76     */

77   int getMinSize() ;
78
79    /**
80     * Set the MinSize value.
81     * @param newMinSize The new MinSize value.
82     */

83   void setMinSize(int newMinSize) ;
84
85    /**
86     * The MaxSize attribute indicates the maximum number of connections for a pool. No more than MaxSize connections will be created in each sub-pool.
87     * @return the MaxSize value.
88     */

89   int getMaxSize() ;
90
91    /**
92     * Set the MaxSize value.
93     * @param newMaxSize The new MaxSize value.
94     */

95   void setMaxSize(int newMaxSize) ;
96
97    /**
98     * The BlockingTimeoutMillis attribute indicates the maximum time to block while waiting for a connection before throwing an exception. Note that this blocks only while waiting for a permit for a connection, and will never throw an exception if creating a new connection takes an inordinately long time.
99     * @return the BlockingTimeout value.
100     */

101   int getBlockingTimeoutMillis() ;
102
103    /**
104     * Set the BlockingTimeout value.
105     * @param newBlockingTimeout The new BlockingTimeout value.
106     */

107   void setBlockingTimeoutMillis(int newBlockingTimeout) ;
108
109    /**
110     * The IdleTimeoutMinutes attribute indicates the maximum time a connection may be idle before being closed. The actual maximum time depends also on the IdleRemover scan time, which is 1/2 the smallest IdleTimeout of any pool.
111     * @return the IdleTimeoutMinutes value.
112     */

113   long getIdleTimeoutMinutes() ;
114
115    /**
116     * Set the IdleTimeoutMinutes value.
117     * @param newIdleTimeoutMinutes The new IdleTimeoutMinutes value.
118     */

119   void setIdleTimeoutMinutes(long newIdleTimeoutMinutes) ;
120
121    /**
122     * The Criteria attribute indicates if Subject (from security domain) or app supplied parameters (such as from getConnection(user, pw)) are used to distinguish connections in the pool. Choices are ByContainerAndApplication (use both), ByContainer (use Subject), ByApplication (use app supplied params only), ByNothing (all connections are equivalent, usually if adapter supports reauthentication)
123     * @return the Criteria value.
124     */

125   java.lang.String JavaDoc getCriteria() ;
126
127    /**
128     * Set the Criteria value.
129     * @param newCriteria The new Criteria value.
130     */

131   void setCriteria(java.lang.String JavaDoc newCriteria) ;
132
133    /**
134     * Separate pools for transactional use
135     * @return true when connections should have different pools for transactional and non-transaction use.
136     */

137   boolean getNoTxSeparatePools() ;
138
139   void setNoTxSeparatePools(boolean value) ;
140
141   /**
142  * FIXME Comment this
143  *
144  * @param prefill
145  */

146   void setPreFill(boolean prefill);
147   
148   /**
149    * FIXME Comment this
150    *
151    * @return
152    */

153   boolean getPreFill();
154   
155   boolean getStrictMin();
156   
157   void setStrictMin(boolean strictMin);
158   
159    /**
160     * The <code>flush</code> method puts all currently checked out connections on a list to be destroyed when returned and disposes of all current pooled connections.
161     */

162   void flush() ;
163
164    /**
165     * Retrieve the connection count.
166     * @return the connection count
167     */

168   int getConnectionCount() ;
169
170    /**
171     * Retrieve the connection created count.
172     * @return the connection created count
173     */

174   int getConnectionCreatedCount() ;
175
176    /**
177     * Retrieve the destrooyed count.
178     * @return the destroyed count
179     */

180   int getConnectionDestroyedCount() ;
181
182   /**
183     * Return raw statistics for all sub pools.
184     *
185     * @return the statistics for all sub pools.
186     */

187    Object JavaDoc listStatistics();
188    
189    /**
190     * Return statistics for all sub pools formatted for consumption.
191     *
192     * @return the formatted statistics.
193     */

194    Object JavaDoc listFormattedSubPoolStatistics();
195    
196    /**
197     * Return statistics for all sub pools formatted using the specified class name.
198     *
199     * @param formatter the class name of the formatter to use.
200     *
201     * @return the formatted statistics.
202     */

203    Object JavaDoc listFormatttedSubPoolStatistics(String JavaDoc formatter);
204    
205    /**
206     * Get the class name of the current statistics formatter
207     *
208     * @return the name of the statistics formatter.
209     */

210    public String JavaDoc getStatisticsFormatter();
211    
212    /**
213     * Set the class name of the statistics formatter
214     *
215     * @param the name of the statistics formatter to use.
216     *
217     */

218    public void setStatisticsFormatter(String JavaDoc formatter);
219    
220    /**
221     * Get background validation
222     *
223     * @return true of false if background validation is enabled.
224     */

225   public boolean getBackGroundValidation();
226   
227   
228    /**
229     * Set the background validation
230     *
231     * @param backgroundValidation true or false if background validation is to be enabled
232     */

233   public void setBackGroundValidation(boolean backgroundValidation);
234   
235    /**
236     * Set the background validation in minutes
237     *
238     * @param backgroundValidationInterval the background interval in minutes
239     */

240    public void setBackGroundValidationMinutes(long backgroundValidationInterval);
241   
242    /**
243     * Get the background validation in minutes
244     *
245     * @return the background validation in minutes
246     */

247    public long getBackGroundValidationMinutes();
248   
249
250    /**
251     * Get the jndi name of the pool
252     *
253     * @return the jndi name of the pool.
254     */

255    public String JavaDoc getPoolJndiName();
256    
257    /**
258     * Set the jndi name of the pool.
259     *
260     * @param poolName the jndi name of the pool.
261     */

262    public void setPoolJndiName(String JavaDoc poolName);
263   
264 }
265
Popular Tags