|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.alicebot.server.sql.pool.ObjectPool org.alicebot.server.sql.pool.DbAccessRefsPoolMgr
public class DbAccessRefsPoolMgr
Manages a pool of references to a database.
Field Summary | |
---|---|
protected java.lang.String |
driver
The name of the driver used by this object. |
protected java.lang.String |
password
The password used by this object. |
protected java.lang.String |
url
The URL string used by this object. |
protected java.lang.String |
user
The user name used by this object. |
Constructor Summary | |
---|---|
DbAccessRefsPoolMgr(java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String password)
Constructs a DbAccessRefsPoolMgr object given
a driver, url, user name and password. |
Method Summary | |
---|---|
protected java.lang.Object |
create()
Initializes the object by attempting to get a DbAccess
object based on the parameters set. |
protected void |
expire(java.lang.Object o)
Expires an object in the pool. |
void |
populate(int connectionCount)
Builds a pool of the specified number of connections. |
void |
returnDbaRef(DbAccess dba)
Checks back in and locks a DbAccess
reference to the database. |
DbAccess |
takeDbaRef()
Checks out and unlocks a DbAccess
reference to the database. |
protected boolean |
validate(java.lang.Object o)
Validates an object in the pool. |
Methods inherited from class org.alicebot.server.sql.pool.ObjectPool |
---|
checkIn, checkOut, cleanUp |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String driver
protected java.lang.String url
protected java.lang.String user
protected java.lang.String password
Constructor Detail |
---|
public DbAccessRefsPoolMgr(java.lang.String driver, java.lang.String url, java.lang.String user, java.lang.String password)
DbAccessRefsPoolMgr
object given
a driver, url, user name and password.
driver
- name of the class representing the Driver to be used by the Driver managerurl
- location of a data source name (dsn)user
- user namepassword
- password for userMethod Detail |
---|
protected java.lang.Object create()
DbAccess
object based on the parameters set.
create
in class ObjectPool
public void populate(int connectionCount)
connectionCount
- the number of connections to createpublic void returnDbaRef(DbAccess dba)
DbAccess
reference to the database.
dba
- the reference to returnpublic DbAccess takeDbaRef()
DbAccess
reference to the database.
protected boolean validate(java.lang.Object o)
ObjectPool
validate
in class ObjectPool
o
- the object to validateprotected void expire(java.lang.Object o)
ObjectPool
expire
in class ObjectPool
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |