com.objectwave.persist.broker
Class RDBConnectionPool

java.lang.Object
  |
  +--com.objectwave.persist.broker.RDBConnectionPool

public class RDBConnectionPool
extends java.lang.Object

Manage multiple connections.

Version:
$Id: RDBConnectionPool.java,v 2.1 2002/03/23 13:42:10 dave_hoag Exp $
Author:
dhoag

Nested Class Summary
static class RDBConnectionPool.Test
          Unit tests.
 
Constructor Summary
RDBConnectionPool()
           
 
Method Summary
protected  void addConnection(RDBConnection con)
          The other way the pool works is maintains the list of connections.
protected  RDBConnection getConnection()
          Every thread will attempt to get a connection to the database.
protected  long getSqlTime()
          Gets the SqlTime attribute of the RDBConnectionPool object
protected  void incrementSqlTime(long l)
          Used for metric information
 void initialize(java.lang.String connectUrl, java.lang.String userName, java.lang.String password, int connectionCount)
          Deprecated.  
protected  void notifyConnection()
           
protected  void resetSqlTime()
          Description of the Method
 void setBrokerProperty(BrokerPropertyIF b)
           
 void setConnections(RDBConnection[] conns)
           
protected  void waitForConnection()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDBConnectionPool

public RDBConnectionPool()
Method Detail

setBrokerProperty

public void setBrokerProperty(BrokerPropertyIF b)
Parameters:
b - The new BrokerProperty value

setConnections

public void setConnections(RDBConnection[] conns)
Parameters:
conns - com.objectwave.persist.RDBConnection[]

initialize

public void initialize(java.lang.String connectUrl,
                       java.lang.String userName,
                       java.lang.String password,
                       int connectionCount)
Deprecated.  

RDBConnectionPool constructor comment. All connections created by this connection pool will have the following parameters. This method MUST be called prior to getConnections being called.

Parameters:
connectUrl - Description of Parameter
userName - Description of Parameter
password - Description of Parameter
connectionCount - Description of Parameter

getSqlTime

protected long getSqlTime()
Gets the SqlTime attribute of the RDBConnectionPool object

Returns:
The SqlTime value

getConnection

protected RDBConnection getConnection()
Every thread will attempt to get a connection to the database. This is the point at which we handle synchronization issues. Once a thread has a connection, it will hold onto the connection as long as necessary. No other threads will be allowed to have that connection until it is set free.

Returns:
The Connection value

incrementSqlTime

protected void incrementSqlTime(long l)
Used for metric information

Parameters:
l - Description of Parameter

resetSqlTime

protected void resetSqlTime()
Description of the Method


addConnection

protected void addConnection(RDBConnection con)
The other way the pool works is maintains the list of connections.

Parameters:
con - The feature to be added to the Connection attribute

notifyConnection

protected final void notifyConnection()

waitForConnection

protected final void waitForConnection()