|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.util.pool.PoolManager
public final class PoolManager
This class can manages a set of database connections pools. It's implemented as a singleton. It provides methods to get or release a connection from a given pool.
Method Summary | |
---|---|
void |
freeConnection(java.lang.String strPoolName,
java.sql.Connection con)
Returns a connection to pool. |
java.sql.Connection |
getConnection(java.lang.String strPoolName)
Returns an available connection from the pool. |
javax.sql.DataSource |
getDataSource(java.lang.String strPoolName)
Returns the datasource for a given pool name |
static PoolManager |
getInstance(java.io.InputStream isDbProperties)
This method returns the unique instance of the PoolManager. |
java.util.Collection<ConnectionService> |
getPools()
Returns all pools available |
ReferenceList |
getPoolsInfos()
Returns pool's infos (currently opened connections) |
void |
release()
Releases all connections from all the pool. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static PoolManager getInstance(java.io.InputStream isDbProperties) throws LuteceInitException
isDbProperties
- An InputStream on a db.properties File to initialiaze the pool if it's not already created.
LuteceInitException
- If any error occuredpublic java.sql.Connection getConnection(java.lang.String strPoolName)
strPoolName
- The pool name
public void freeConnection(java.lang.String strPoolName, java.sql.Connection con)
strPoolName
- Pool's namecon
- A released connectionpublic void release()
public java.util.Collection<ConnectionService> getPools()
public ReferenceList getPoolsInfos()
public javax.sql.DataSource getDataSource(java.lang.String strPoolName)
strPoolName
- The Pool name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |