|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectweb.jonas.dbm.ConnectionManager
DataSource implementation. Manage a pool of connections.
| Constructor Summary | |
ConnectionManager()
Constructor for Factory |
|
ConnectionManager(boolean isClient)
Always called with true |
|
| Method Summary | |
void |
adjust()
Adjust the pool size, according to poolMax and poolMin values. |
java.lang.String |
checkConnection(java.lang.String testStatement)
Check on a connection the test statement |
void |
closeAllConnection()
Close all connections in the pool, when server is shut down. |
void |
connectionClosed(javax.sql.ConnectionEvent event)
|
void |
connectionErrorOccurred(javax.sql.ConnectionEvent event)
|
void |
freeConnections(javax.transaction.Transaction tx)
The transaction has committed (or rolled back). |
int |
getBusyMaxRecent()
|
int |
getBusyMinRecent()
|
int |
getCheckLevel()
|
java.lang.String |
getClassName()
|
java.sql.Connection |
getConnection()
|
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
Attempts to establish a connection with the data source that this DataSource object represents. |
int |
getConnectionFailures()
|
int |
getConnectionLeaks()
|
static ConnectionManager |
getConnectionManager(java.lang.String dsname)
get the ConnectionManager matching the DataSource name |
int |
getCurrentBusy()
|
int |
getCurrentInTx()
|
int |
getCurrentOpened()
|
int |
getCurrentWaiters()
|
java.lang.String |
getDataSourceDescription()
|
java.lang.String |
getDatasourceName()
|
java.lang.String |
getDSName()
|
int |
getLoginTimeout()
|
java.io.PrintWriter |
getLogWriter()
|
java.lang.String |
getMapperName()
|
int |
getMaxAge()
|
long |
getMaxAgeMilli()
|
int |
getMaxOpenTime()
|
long |
getMaxOpenTimeMilli()
|
int |
getMaxWaiters()
|
int |
getMaxWaitTime()
|
int |
getOpenedCount()
|
java.lang.String |
getPassword()
|
Pool |
getPool()
|
int |
getPoolMax()
|
int |
getPoolMin()
|
int |
getPstmtMax()
|
javax.naming.Reference |
getReference()
Retrieves the Reference of this object. |
int |
getRejectedFull()
|
int |
getRejectedOpen()
|
int |
getRejectedOther()
|
int |
getRejectedTimeout()
|
int |
getSamplingPeriod()
|
int |
getServedOpen()
|
java.lang.String |
getTestStatement()
|
java.lang.String |
getTransactionIsolation()
|
java.lang.String |
getUrl()
|
java.lang.String |
getUserName()
|
int |
getWaiterCount()
|
int |
getWaitersHigh()
|
int |
getWaitersHighRecent()
|
long |
getWaitingHigh()
|
long |
getWaitingHighRecent()
|
long |
getWaitingTime()
|
javax.sql.XAConnection |
getXAConnection()
|
javax.sql.XAConnection |
getXAConnection(java.lang.String user,
java.lang.String passwd)
Attempts to establish a physical database connection, using the given user name and password. |
boolean |
isClientCase()
This manager is in the client case or not ? |
JManagedConnection |
openConnection(java.lang.String user,
javax.transaction.Transaction tx)
lookup connection in the pool for this user/tx |
void |
poolConfigure(java.lang.String connchecklevel,
java.lang.String connmaxage,
java.lang.String maxopentime,
java.lang.String connteststmt,
java.lang.String pstmtmax,
java.lang.String minconpool,
java.lang.String maxconpool,
java.lang.String maxwaittime,
java.lang.String maxwaiters,
java.lang.String samplingperiod)
Configure the Connection pool. |
void |
recomputeBusy()
compute current min/max busyConnections |
void |
sampling()
make samples with some monitoring values |
void |
setCheckLevel(int level)
|
void |
setClassName(java.lang.String s)
|
void |
setDataSourceDescription(java.lang.String dsDesc)
|
void |
setDatasourceName(java.lang.String s)
|
void |
setDSName(java.lang.String s)
|
void |
setLoginTimeout(int seconds)
|
void |
setLogWriter(java.io.PrintWriter out)
|
void |
setMapperName(java.lang.String mappername)
|
void |
setMaxAge(int mn)
|
void |
setMaxOpenTime(int mn)
|
void |
setMaxWaiters(int nb)
|
void |
setMaxWaitTime(int sec)
|
void |
setPassword(java.lang.String s)
|
void |
setPoolMax(int max)
|
void |
setPoolMin(int min)
|
void |
setPstmtMax(int nb)
|
void |
setSamplingPeriod(int sec)
|
void |
setTestStatement(java.lang.String s)
|
void |
setTransactionIsolation(java.lang.String level)
|
void |
setUrl(java.lang.String s)
|
void |
setUserName(java.lang.String s)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConnectionManager()
throws java.lang.Exception
public ConnectionManager(boolean isClient)
throws java.lang.Exception
| Method Detail |
public boolean isClientCase()
public Pool getPool()
public static ConnectionManager getConnectionManager(java.lang.String dsname)
public java.lang.String getDSName()
public void setDSName(java.lang.String s)
s - Jndi name for the datasourcepublic java.lang.String getDatasourceName()
public void setDatasourceName(java.lang.String s)
public java.lang.String getUrl()
public void setUrl(java.lang.String s)
public java.lang.String getClassName()
public void setClassName(java.lang.String s)
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionpublic java.lang.String getUserName()
public void setUserName(java.lang.String s)
public java.lang.String getPassword()
public void setPassword(java.lang.String s)
public void setTransactionIsolation(java.lang.String level)
public java.lang.String getTransactionIsolation()
public void setMapperName(java.lang.String mappername)
public java.lang.String getMapperName()
public java.lang.String getDataSourceDescription()
public void setDataSourceDescription(java.lang.String dsDesc)
dsDesc - the desrciption of this datasourcepublic int getPoolMin()
getPoolMin in interface Poolpublic void setPoolMin(int min)
setPoolMin in interface Poolmin - minimum connection pool size to be set.public int getPoolMax()
getPoolMax in interface Poolpublic void setPoolMax(int max)
setPoolMax in interface Poolmax - max pool size. -1 means "no limit".public int getMaxAge()
getMaxAge in interface Poolpublic long getMaxAgeMilli()
getMaxAgeMilli in interface Poolpublic void setMaxAge(int mn)
setMaxAge in interface Poolmn - max age of connection in minutespublic int getMaxOpenTime()
getMaxOpenTime in interface Poolpublic long getMaxOpenTimeMilli()
getMaxOpenTimeMilli in interface Poolpublic void setMaxOpenTime(int mn)
setMaxOpenTime in interface Poolmn - max time of open connection in minutespublic int getMaxWaitTime()
getMaxWaitTime in interface Poolpublic void setMaxWaitTime(int sec)
setMaxWaitTime in interface Poolsec - max time to wait for a connection, in secondspublic int getMaxWaiters()
getMaxWaiters in interface Poolpublic void setMaxWaiters(int nb)
setMaxWaiters in interface Poolnb - max nb of waiterspublic int getSamplingPeriod()
getSamplingPeriod in interface Poolpublic void setSamplingPeriod(int sec)
setSamplingPeriod in interface Poolsec - sampling period in sec.public int getCheckLevel()
getCheckLevel in interface Poolpublic void setCheckLevel(int level)
setCheckLevel in interface Poollevel - jdbc connection checking level (0, 1, or 2)public int getPstmtMax()
public void setPstmtMax(int nb)
nb - PreparedStatement cache sizepublic java.lang.String getTestStatement()
getTestStatement in interface Poolpublic void setTestStatement(java.lang.String s)
setTestStatement in interface Pools - test statement
public void poolConfigure(java.lang.String connchecklevel,
java.lang.String connmaxage,
java.lang.String maxopentime,
java.lang.String connteststmt,
java.lang.String pstmtmax,
java.lang.String minconpool,
java.lang.String maxconpool,
java.lang.String maxwaittime,
java.lang.String maxwaiters,
java.lang.String samplingperiod)
connchecklevel - JDBC connection checking levelconnmaxage - JDBC connection maximum agemaxopentime - JDBC connection maximum open timeconnteststmt - SQL query for test statementpstmtmax - prepare statement pool size per managed connectionminconpool - Min size for the connection poolmaxconpool - Max size for the connection poolmaxwaittime - Max time to wait for a connection (in seconds)maxwaiters - Max nb of waiters for a connectionsamplingperiod - sampling period in sec.public int getBusyMaxRecent()
getBusyMaxRecent in interface Poolpublic int getBusyMinRecent()
getBusyMinRecent in interface Poolpublic int getCurrentWaiters()
getCurrentWaiters in interface Poolpublic int getOpenedCount()
getOpenedCount in interface Poolpublic int getConnectionFailures()
getConnectionFailures in interface Poolpublic int getConnectionLeaks()
getConnectionLeaks in interface Poolpublic int getServedOpen()
getServedOpen in interface Poolpublic int getRejectedFull()
getRejectedFull in interface Poolpublic int getRejectedTimeout()
getRejectedTimeout in interface Poolpublic int getRejectedOther()
getRejectedOther in interface Poolpublic int getRejectedOpen()
getRejectedOpen in interface Poolpublic int getWaitersHigh()
getWaitersHigh in interface Poolpublic int getWaitersHighRecent()
getWaitersHighRecent in interface Poolpublic int getWaiterCount()
getWaiterCount in interface Poolpublic long getWaitingTime()
getWaitingTime in interface Poolpublic long getWaitingHigh()
getWaitingHigh in interface Poolpublic long getWaitingHighRecent()
getWaitingHighRecent in interface Pool
public int getLoginTimeout()
throws java.sql.SQLException
getLoginTimeout in interface javax.sql.DataSourcejava.sql.SQLException
public void setLoginTimeout(int seconds)
throws java.sql.SQLException
setLoginTimeout in interface javax.sql.DataSourcejava.sql.SQLException
public java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
getLogWriter in interface javax.sql.DataSourcejava.sql.SQLException
public void setLogWriter(java.io.PrintWriter out)
throws java.sql.SQLException
setLogWriter in interface javax.sql.DataSourcejava.sql.SQLException
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLException
public java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourceusername - - the database user on whose behalf the connection is being madepassword - - the user's password
java.sql.SQLException - - if a database access error occurs
public javax.sql.XAConnection getXAConnection()
throws java.sql.SQLException
getXAConnection in interface javax.sql.XADataSourcejava.sql.SQLException
public javax.sql.XAConnection getXAConnection(java.lang.String user,
java.lang.String passwd)
throws java.sql.SQLException
getXAConnection in interface javax.sql.XADataSourceuser - - the database user on whose behalf the connection is being madepasswd - - the user's password
java.sql.SQLException - - if a database access error occurs
public javax.naming.Reference getReference()
throws javax.naming.NamingException
getReference in interface javax.naming.Referenceablejavax.naming.NamingException - If a naming exception was encountered while
retrieving the reference.public void connectionClosed(javax.sql.ConnectionEvent event)
connectionClosed in interface javax.sql.ConnectionEventListenerpublic void connectionErrorOccurred(javax.sql.ConnectionEvent event)
connectionErrorOccurred in interface javax.sql.ConnectionEventListenerpublic int getCurrentOpened()
getCurrentOpened in interface Poolpublic int getCurrentBusy()
getCurrentBusy in interface Poolpublic void recomputeBusy()
public int getCurrentInTx()
getCurrentInTx in interface Poolpublic void sampling()
public void adjust()
public JManagedConnection openConnection(java.lang.String user,
javax.transaction.Transaction tx)
throws java.sql.SQLException
user - user nametx - Transaction the connection is involved
java.sql.SQLException - Cannot open a connection because the pool's max size is reachedpublic void freeConnections(javax.transaction.Transaction tx)
tx - the non null transactionpublic void closeAllConnection()
public java.lang.String checkConnection(java.lang.String testStatement)
throws java.sql.SQLException
checkConnection in interface PooltestStatement - the statement to use for test
java.sql.SQLException - If an error occured when trying to test (not due to the test itself,
but to other preliminary or post operation).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||