|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.gee.publication.servlets.jdbc.ConnectionPool
public class ConnectionPool
Class ConnectionPool manages a pool of connections to the database for a certain (virtual) host. Clients can try to get a connection, optionally wait until one becomes available, get the connection, do something with it and return the connection to the pool. Note that the ConnectionPool decides whether or not to reuse connections. The current implementation does not reuse connections.
| Field Summary | |
|---|---|
protected String |
_dbURL
|
protected int |
_freeConnections
Available number of connections |
protected int |
_numberOfConnections
Maximum number of connections |
protected ArrayList |
_requestQueue
Clients that should be notified when a connection becomes available. |
static Object |
ABORT
|
static Object |
WAIT
|
| Constructor Summary | |
|---|---|
ConnectionPool(String host,
boolean useInProcessDatabase)
Construct a new ConnectionPool for the specified host. |
|
| Method Summary | |
|---|---|
protected Connection |
_getNewConnection(String name,
String password)
|
Object |
getConnection(Object client)
Get a connection for the specified client. |
void |
returnConnection(Connection connection)
Return a connection to the pool of free connections; if there is a waiting client, notify it. |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Object WAIT
public static final Object ABORT
protected String _dbURL
protected int _numberOfConnections
protected int _freeConnections
protected ArrayList _requestQueue
| Constructor Detail |
|---|
public ConnectionPool(String host,
boolean useInProcessDatabase)
host - The name of the host.| Method Detail |
|---|
public int size()
public Object getConnection(Object client)
returnConnection(java.sql.Connection)public void returnConnection(Connection connection)
connection - The connection to return to the pool.
protected Connection _getNewConnection(String name,
String password)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||