|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.controller.connection.AbstractConnectionManager org.objectweb.cjdbc.controller.connection.AbstractPoolConnectionManager
This connection manager uses a pool of persistent connections with the
database. The allocation/release policy is implemented by the subclasses
(abstract
AbstractConnectionManager.getConnection()
/
AbstractConnectionManager.releaseConnection(Connection)
from
AbstractConnectionManager
).
Field Summary | |
protected java.util.ArrayList |
activeConnections
Pool of currently used connections ( Vector type because
synchronisation is needed). |
protected java.util.LinkedList |
freeConnections
Stack of available connections (pool). |
protected int |
poolSize
Size of the connection pool with the real database. |
Fields inherited from class org.objectweb.cjdbc.controller.connection.AbstractConnectionManager |
backendName, backendUrl, driverClassName, driverPath, initialized, logger, rLogin, rPassword |
Fields inherited from interface org.objectweb.cjdbc.common.xml.XmlComponent |
DOCTYPE_CONTROLLER, DOCTYPE_DB, XML_VERSION |
Constructor Summary | |
AbstractPoolConnectionManager(java.lang.String backendUrl,
java.lang.String backendName,
java.lang.String login,
java.lang.String password,
java.lang.String driverPath,
java.lang.String driverClassName,
int poolSize)
Creates a new AbstractPoolConnectionManager instance. |
Method Summary | |
void |
finalizeConnections()
Releases all the connections to the database. |
int |
getCurrentNumberOfConnections()
Get the current number of connections open for this connection manager. |
void |
initializeConnections()
Initializes the connection(s) to the database. |
void |
initializeConnections(int initPoolSize)
Initialize initPoolSize connections in the pool. |
Methods inherited from class org.objectweb.cjdbc.controller.connection.AbstractConnectionManager |
clone, copy, deleteConnection, deleteConnection, finalize, getConnection, getConnection, getConnectionFromDriver, getDriverClassName, getDriverPath, getLogin, getPassword, getVLogin, getXml, getXmlImpl, isInitialized, releaseConnection, releaseConnection, retrieveConnection, setDriverClassName, setDriverPath, setLogin, setPassword, setVLogin |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient java.util.LinkedList freeConnections
protected transient java.util.ArrayList activeConnections
Vector
type because
synchronisation is needed).
protected int poolSize
Constructor Detail |
public AbstractPoolConnectionManager(java.lang.String backendUrl, java.lang.String backendName, java.lang.String login, java.lang.String password, java.lang.String driverPath, java.lang.String driverClassName, int poolSize)
AbstractPoolConnectionManager
instance.
backendUrl
- URL of the DatabaseBackend
owning this
connection manager.backendName
- name of the DatabaseBackend
owning this
connection manager.login
- backend connection login to be used by this connection
manager.password
- backend connection password to be used by this connection
manager.driverPath
- path for driverdriverClassName
- class name for driverpoolSize
- size of the connection pool.Method Detail |
public void initializeConnections() throws java.sql.SQLException
AbstractConnectionManager
initializeConnections
in class AbstractConnectionManager
java.sql.SQLException
- if an error occurs.AbstractConnectionManager.initializeConnections()
public void initializeConnections(int initPoolSize) throws java.sql.SQLException
initPoolSize
- number of connections to initialize
java.sql.SQLException
- if an error occurspublic void finalizeConnections() throws java.sql.SQLException
AbstractConnectionManager
finalizeConnections
in class AbstractConnectionManager
java.sql.SQLException
- if an error occurs.AbstractConnectionManager.finalizeConnections()
public int getCurrentNumberOfConnections()
AbstractConnectionManager
getCurrentNumberOfConnections
in class AbstractConnectionManager
AbstractConnectionManager.getCurrentNumberOfConnections()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |