|
PAJES 3.0.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pajes.db.ConnectionPoolConfiguration
public class ConnectionPoolConfiguration
Reads an XML-based deployment descriptor that defines ConnectionPool instances.
The deployment descriptor must have the following format:
<db> <pool> <name>The logical name of the connection pool</name> <driver>The JDBC driver class</driver> <server>The address of a JDBC data source</server> <user>The database userid</user> <password>The Base64 encoded database user's password</password> <init>The number of connections to initially open</init> <max>The maximum number of connections to open</max> <interval>The number of milliseconds between checking for a free connection when one is not available</interval> <timeout>The maximum number of milliseconds to wait for a free connection to become available</timeout> <destroy>A string of SQL that will be executed when the pool is destroyed</timeout> </pool> <db>
The encoded password may be obtained by calling the Base64Encoder class from the command line and passing the
password. For example:
java org.pajes.util.Base64Encoder password
The timeout, interval and destroy
elements are optional, and default to 60000, 1000, and null respectively.
As many pools may be specified in the deployment descriptor as are required.
| Field Summary | |
|---|---|
static java.lang.String |
DB_ELEMENT
The root element |
static java.lang.String |
DESTROY_ELEMENT
The element containing a string of SQL that will be executed when the pool is destroyed. |
static java.lang.String |
DRIVER_ELEMENT
The element containing the JDBC driver class. |
static java.lang.String |
INIT_ELEMENT
The element containing the number of connections to initially open. |
static java.lang.String |
INTERVAL_ELEMENT
The element containing the number of milliseconds between checking for a free connection when one is not available. |
static java.lang.String |
MAX_ELEMENT
The element containing the maximum number of connections to open. |
static java.lang.String |
NAME_ELEMENT
The element containing the logical name of the connection pool. |
static java.lang.String |
PASSWORD_ELEMENT
The element containing the Base64 encoded database user's password. |
static java.lang.String |
POOL_ELEMENT
The element containing a pool definition. |
static java.lang.String |
SERVER_ELEMENT
The element containing the address of a JDBC data source. |
static java.lang.String |
TIMEOUT_ELEMENT
The element containing the maximum number of milliseconds to wait for a free connection to become available. |
static java.lang.String |
USER_ELEMENT
The element containing the database userid. |
| Constructor Summary | |
|---|---|
ConnectionPoolConfiguration(java.io.InputStream in,
javax.servlet.ServletContext context)
Reads the specified input stream and creates ConnectionPool
instances within the nominated ConnectionManager. |
|
| Method Summary | |
|---|---|
ConnectionPoolDefinition |
getPoolDefinition(java.lang.String pool)
Returns the ConnectionPoolDefinition for the specified pool. |
java.lang.String[] |
getPoolNames()
Returns the names of the connection pools added to the ConnectionManager from this deployment descriptor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DB_ELEMENT
public static final java.lang.String DESTROY_ELEMENT
public static final java.lang.String DRIVER_ELEMENT
public static final java.lang.String INIT_ELEMENT
public static final java.lang.String INTERVAL_ELEMENT
public static final java.lang.String MAX_ELEMENT
public static final java.lang.String NAME_ELEMENT
public static final java.lang.String PASSWORD_ELEMENT
public static final java.lang.String POOL_ELEMENT
public static final java.lang.String SERVER_ELEMENT
public static final java.lang.String TIMEOUT_ELEMENT
public static final java.lang.String USER_ELEMENT
| Constructor Detail |
|---|
public ConnectionPoolConfiguration(java.io.InputStream in,
javax.servlet.ServletContext context)
throws java.io.IOException
ConnectionPool
instances within the nominated ConnectionManager.
in - the input stream from which the XML deployment descriptor will
be read.context - the Servlet Context.
java.io.IOException - if an error occurs reading or parsing the deployment
descriptor.
ConnectionPoolException - if an error is detected in the deployment descriptor.| Method Detail |
|---|
public ConnectionPoolDefinition getPoolDefinition(java.lang.String pool)
pool - the name of the required pool.
public java.lang.String[] getPoolNames()
|
PAJES 3.0.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||