|
|||||||||||
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 org.objectweb.cjdbc.controller.connection.RandomWaitPoolConnectionManager
This connection manager waits when the pool is empty. Requests are stacked using the Java wait/notify mechanism. Therefore the FIFO order is not guaranteed and the first request to get the freed connection is the thread that gets elected by the scheduler.
Field Summary | |
private int |
timeout
Time to wait for a connection in milliseconds (0 means wait forever). |
Fields inherited from class org.objectweb.cjdbc.controller.connection.AbstractPoolConnectionManager |
activeConnections, freeConnections, poolSize |
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 | |
RandomWaitPoolConnectionManager(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,
int timeout)
Creates a new RandomWaitPoolConnectionManager instance. |
Method Summary | |
protected java.lang.Object |
clone()
|
void |
deleteConnection(java.sql.Connection c)
Delete a connection that is no more valid. |
java.sql.Connection |
getConnection()
Gets a connection from the pool. |
int |
getTimeout()
Gets the timeout. |
java.lang.String |
getXmlImpl()
Gets xml formatted information on this connection manager |
void |
releaseConnection(java.sql.Connection c)
Releases a connection. |
Methods inherited from class org.objectweb.cjdbc.controller.connection.AbstractPoolConnectionManager |
finalizeConnections, getCurrentNumberOfConnections, initializeConnections, initializeConnections |
Methods inherited from class org.objectweb.cjdbc.controller.connection.AbstractConnectionManager |
copy, deleteConnection, finalize, getConnection, getConnectionFromDriver, getDriverClassName, getDriverPath, getLogin, getPassword, getVLogin, getXml, isInitialized, 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 |
private int timeout
Constructor Detail |
public RandomWaitPoolConnectionManager(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, int timeout)
RandomWaitPoolConnectionManager
instance.
backendUrl
- URL of the DatabaseBackend
owning this
connection managerbackendName
- name of the DatabaseBackend
owning this
connection managerlogin
- backend connection login to be used by this connection managerpassword
- backend connection password to be used by this connection
managerdriverPath
- path for driverdriverClassName
- class name for driverpoolSize
- size of the connection pooltimeout
- time to wait for a connection in seconds (0 means wait
forever)Method Detail |
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractConnectionManager
java.lang.CloneNotSupportedException
Object.clone()
public int getTimeout()
int
value.public java.sql.Connection getConnection() throws UnreachableBackendException
If the pool is empty, this methods blocks until a connection is freed or the timeout expires.
getConnection
in class AbstractConnectionManager
null
if the timeout
has expired.
UnreachableBackendException
- if the backend must be disabledAbstractConnectionManager.getConnection()
public void releaseConnection(java.sql.Connection c)
AbstractConnectionManager
releaseConnection
in class AbstractConnectionManager
c
- the connection to release.AbstractConnectionManager.releaseConnection(Connection)
public void deleteConnection(java.sql.Connection c)
AbstractConnectionManager
deleteConnection
in class AbstractConnectionManager
c
- the connection to delete.AbstractConnectionManager.deleteConnection(Connection)
public java.lang.String getXmlImpl()
AbstractConnectionManager
getXmlImpl
in class AbstractConnectionManager
AbstractConnectionManager.getXmlImpl()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |