public class AS400PoolManager
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private static boolean |
cvActive
A flag indicating if the pools are currently active.
|
private static java.util.Hashtable<java.lang.String,AS400ConnectionPool> |
cvPools
The connection pools for the
AS400PoolManager . |
private static long |
serialVersionUID
The class' serialization version id.
|
Constructor and Description |
---|
AS400PoolManager() |
Modifier and Type | Method and Description |
---|---|
private static void |
createPools()
Creates the
AS400ConnectionPool objects. |
static void |
freeBadConnection(com.ibm.as400.access.AS400 conn)
Discards a used connection in an assumed pool.
|
static void |
freeBadConnection(java.lang.String name,
com.ibm.as400.access.AS400 conn)
Discards a used connection in the specified pool.
|
static void |
freeConnection(com.ibm.as400.access.AS400 conn)
Returns a connection back to an assumed pool.
|
static void |
freeConnection(java.lang.String name,
com.ibm.as400.access.AS400 conn)
Returns a connection back to the specified pool.
|
static com.ibm.as400.access.AS400 |
getConnection()
Retrieves a connection from an assumed pool.
|
static com.ibm.as400.access.AS400 |
getConnection(java.lang.String name)
Retrieves a connection from the specified pool.
|
static java.lang.String |
getConnectionConsumers(java.lang.String name)
Returns a sorted list of the connection consumers associated with the
connections currently in-use, suitable for display on a web page (list
is delimited by <br>).
|
static java.lang.String |
getConnectionStats(java.lang.String name)
Returns a string containing information on total number of connections,
number of checked out connections, and number of available ones.
|
static boolean |
hasPools()
Answers if any connection pools are configured.
|
static boolean |
isActive()
Answers if the set of connection pools being managed is active.
|
static void |
restart()
Allows the pool to process connections normally.
|
static void |
stopAll()
Shuts down the connection pools and forces the pool to to refuse further
connections until restarted.
|
private static final long serialVersionUID
private static java.util.Hashtable<java.lang.String,AS400ConnectionPool> cvPools
AS400PoolManager
.private static boolean cvActive
private static void createPools()
AS400ConnectionPool
objects.public static void freeConnection(com.ibm.as400.access.AS400 conn)
conn
- (AS400) The connection to return.public static void freeConnection(java.lang.String name, com.ibm.as400.access.AS400 conn)
name
- (String) A connection pool name.conn
- (AS400) The connection to return.public static void freeBadConnection(com.ibm.as400.access.AS400 conn)
conn
- (AS400) The connection to discard.public static void freeBadConnection(java.lang.String name, com.ibm.as400.access.AS400 conn)
name
- (String) A connection pool name.conn
- (AS400) The connection to discard.public static com.ibm.as400.access.AS400 getConnection()
public static com.ibm.as400.access.AS400 getConnection(java.lang.String name)
name
- (String) A connection pool name.public static java.lang.String getConnectionConsumers(java.lang.String name)
name
- (String) A connection pool name.public static java.lang.String getConnectionStats(java.lang.String name)
name
- (String) A connection pool name.public static boolean hasPools()
true
if pools are configured, otherwise
false
.public static boolean isActive()
true
if the set of pools is active,
otherwise false
.public static void restart()
public static void stopAll()