KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > management > server > ConnectionPoolMXBean


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Scott Ferguson
28  */

29
30 package com.caucho.management.server;
31
32 import com.caucho.jmx.Description;
33 import com.caucho.jmx.Units;
34
35 /**
36  * MBean API for the JCA connection pool.
37  *
38  * <pre>
39  * resin:type=ConnectionPool,name=jdbc/resin,...
40  * </pre>
41  */

42 @Description("A pool of reusable connections to a database")
43 public interface ConnectionPoolMXBean extends ManagedObjectMXBean {
44   //
45
// Configuration
46
//
47

48   /**
49    * Returns the maximum number of connections.
50    */

51   @Description("The configured maximum number of connections")
52   public int getMaxConnections();
53   
54   /**
55    * Returns the number of overflow connections.
56    */

57   @Description("The configured maximum number of overflow connections")
58   public int getMaxOverflowConnections();
59   
60   /**
61    * Returns the max number of connections trying to connect.
62    */

63   @Description("The configured maximum number of simultaneous connection creation")
64   public int getMaxCreateConnections();
65   
66   /**
67    * Returns the pool idle time in milliseconds.
68    */

69   @Units("milliseconds")
70   @Description("The configured maximum time in milliseconds that a connection remains in the idle pool before it is closed")
71   public long getMaxIdleTime();
72   
73   /**
74    * Returns the pool active time in milliseconds.
75    */

76   @Description("The configured maximum time in milliseconds that a connection is allowed to be active")
77   @Units("milliseconds")
78   public long getMaxActiveTime();
79   
80   /**
81    * Returns the pool time in milliseconds.
82    */

83   @Description("The configured maximum age in milliseconds of a connection before it is closed regardless of it's usage pattern")
84   @Units("milliseconds")
85   public long getMaxPoolTime();
86   
87   /**
88    * How long to wait for connections when timed out.
89    */

90   @Units("milliseconds")
91   @Description("The configured maximum time in milliseconds to wait for a connection before a failure is returned to the client")
92   public long getConnectionWaitTime();
93   
94   /**
95    * Returns true for the JCA shared attribute.
96    */

97   public boolean isShareable();
98   
99   /**
100    * Returns true if the local-transaction-optimization is allowed
101    */

102   public boolean isLocalTransactionOptimization();
103   
104   //
105
// Statistics
106
//
107

108   /**
109    * Returns the total number of connections.
110    */

111   @Description("The current number of idle and active connections")
112   public int getConnectionCount();
113
114   /**
115    * Returns the number of active connections.
116    */

117   @Description("The current number of active connections")
118   public int getConnectionActiveCount();
119
120   /**
121    * Returns the number of idle connections.
122    */

123   @Description("The current number of idle connections")
124   public int getConnectionIdleCount();
125
126   //
127
// Operations
128
//
129

130   /**
131    * Clears all idle connections in the pool.
132    */

133   @Description("Clear idle connections in the pool")
134   public void clear();
135 }
136
Popular Tags