|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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, initialized, logger, rLogin, rPassword |
Constructor Summary | |
RandomWaitPoolConnectionManager(java.lang.String backendUrl,
java.lang.String backendName,
java.lang.String login,
java.lang.String password,
int poolSize,
int timeout)
Creates a new RandomWaitPoolConnectionManager instance. |
Method Summary | |
java.sql.Connection |
getConnection()
Gets a connection from the pool. |
java.lang.String |
getInformation()
Gets information about this connection manager |
int |
getTimeout()
Gets the timeout. |
java.lang.String |
getXmlInformation()
Gets xml formatted information on this connection manager |
void |
releaseConnection(java.sql.Connection c)
Releases a connection and puts it back to the pool. |
Methods inherited from class org.objectweb.cjdbc.controller.connection.AbstractPoolConnectionManager |
finalizeConnections, initializeConnections, initializeConnections |
Methods inherited from class org.objectweb.cjdbc.controller.connection.AbstractConnectionManager |
finalize, getConnection, getLogin, getPassword, isInitialized, releaseConnection, retrieveConnection, setLogin, setPassword |
Methods inherited from class java.lang.Object |
clone, 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, 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
managerpoolSize
- size of the connection pooltimeout
- time to wait for a connection in seconds (0 means wait
forever)Method Detail |
public int getTimeout()
int
value.public java.sql.Connection getConnection()
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.AbstractConnectionManager.getConnection()
public void releaseConnection(java.sql.Connection c)
AbstractPoolConnectionManager
releaseConnection
in class AbstractPoolConnectionManager
c
- the connection to release.AbstractPoolConnectionManager.releaseConnection(Connection)
public java.lang.String getXmlInformation()
AbstractConnectionManager
getXmlInformation
in class AbstractConnectionManager
AbstractConnectionManager.getXmlInformation()
public java.lang.String getInformation()
AbstractConnectionManager
getInformation
in class AbstractConnectionManager
String
value containing information.AbstractConnectionManager.getInformation()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |