|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jonas.dbm.ConnectionManager
JOnAS generic implementation of DataSource to manage an underlying JDBC-XA driver (XADataSource, XAConnection, XAResource, ...) This class acts as a factory for Connection objects. Its main goal is to manage a pool of XAConnection objects, to avoid closing the actual Connection on DBMS, and to deal with distributed transactions. This DataSource is registered in JNDI (=> implements Referenceable)
Constructor Summary | |
ConnectionManager()
Constructor for Factory |
Method Summary | |
java.lang.String |
_getDSName()
|
void |
_setDSName(java.lang.String s)
|
void |
closeAllConnection()
|
void |
connectionClosed(javax.sql.ConnectionEvent event)
Invoked when the application calls close() on its representation of the connection. |
void |
connectionErrorOccurred(javax.sql.ConnectionEvent event)
Invoked when a fatal connection error occurs, just before an SQLException is thrown to the application. |
java.lang.String |
getClassName()
|
java.sql.Connection |
getConnection()
Attempt to establish a database connection. |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
Attempt to establish a database connection. |
static ConnectionManager |
getConnectionManager(java.lang.String dsname)
get the ConnectionManager matching the DataSource name |
java.lang.Integer |
getCurrentNumberOfJDBCConnectionOpen()
MBean method: |
java.lang.String |
getDataSourceDescription()
MBean Method: |
java.lang.String |
getDataSourceFactory()
MBean method: |
java.lang.String |
getDatasourceName()
|
java.lang.String |
getDataSourceType()
Mbean Method: return the type of this data source |
java.lang.String |
getDataSourceXADataName()
MBean method: |
java.lang.String |
getDSName()
MBean method: |
java.lang.Integer |
getJDBCConnCheckLevel()
MBean method: |
java.lang.Integer |
getJDBCConnMaxAge()
MBean method: |
java.lang.Integer |
getJDBCDeadLockPool()
MBean method: |
java.lang.Integer |
getJDBCLoopWaitPool()
MBean method: |
java.lang.Integer |
getJDBCMaxConnPool()
MBean method: |
java.lang.Integer |
getJDBCMinConnPool()
MBean method: |
java.lang.Integer |
getJDBCSleepTimeOut()
MBean method: |
java.lang.String |
getJDBCTestStatement()
MBean method: |
int |
getLoginTimeout()
Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. |
java.io.PrintWriter |
getLogWriter()
Get the log writer for this data source. |
java.lang.String |
getMapperName()
|
java.lang.String |
getPassword()
|
javax.naming.Reference |
getReference()
Retrieves the Reference of this object. |
static org.objectweb.transaction.api.ResourceManagerEventListener |
getResourceManagerEventListener()
|
java.lang.String |
getTransactionIsolation()
|
java.lang.String |
getUrl()
|
java.lang.String |
getUserName()
|
void |
poolConfigure(java.lang.String connchecklevel,
java.lang.String connmaxage,
java.lang.String connteststmt)
Configure the Connection pool. |
void |
setClassName(java.lang.String s)
|
void |
setDataSourceDescription(java.lang.String dsDesc)
Management Method: |
void |
setDatasourceName(java.lang.String s)
|
void |
setDataSourceXADataName(java.lang.String xaName)
Management method: |
void |
setDSName(java.lang.String s)
|
void |
setJDBCConnCheckLevel(java.lang.Integer level)
MBean method: |
void |
setJDBCConnMaxAge(java.lang.Integer age)
MBean method: |
void |
setJDBCDeadLockPool(java.lang.Integer size)
MBean method: do nothing |
void |
setJDBCLoopWaitPool(java.lang.Integer size)
MBean method: do nothing |
void |
setJDBCMaxConnPool(java.lang.Integer max)
MBean method: do nothing |
void |
setJDBCMinConnPool(java.lang.Integer min)
MBean method: do nothing |
void |
setJDBCSleepTimeOut(java.lang.Integer timeOut)
MBean method: do nothing |
void |
setJDBCTestStatement(java.lang.String test)
MBean method: |
void |
setLoginTimeout(int seconds)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. |
void |
setLogWriter(java.io.PrintWriter out)
Set the log writer for this data source. |
void |
setMapperName(java.lang.String mappername)
|
void |
setPassword(java.lang.String s)
|
void |
setRMEListener(org.objectweb.transaction.api.ResourceManagerEventListener rmel)
|
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()
Method Detail |
public void setRMEListener(org.objectweb.transaction.api.ResourceManagerEventListener rmel)
public java.lang.String _getDSName()
public void _setDSName(java.lang.String s)
s
- jndi name for the datasourcepublic java.lang.String getUrl()
getUrl
in interface JmxDataSourceMBean
org.objectweb.jonas.dbm.JmxDataSourceMBean
public void setUrl(java.lang.String s)
public java.lang.String getClassName()
getClassName
in interface JmxDataSourceMBean
org.objectweb.jonas.dbm.JmxDataSourceMBean
public void setClassName(java.lang.String s)
public java.lang.String getUserName()
getUserName
in interface JmxDataSourceMBean
org.objectweb.jonas.dbm.JmxDataSourceMBean
public void setUserName(java.lang.String s)
public java.lang.String getPassword()
getPassword
in interface JmxDataSourceMBean
org.objectweb.jonas.dbm.JmxDataSourceMBean
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 void poolConfigure(java.lang.String connchecklevel, java.lang.String connmaxage, java.lang.String connteststmt)
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
- - if a database-access error occurs.public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
user
- - the database user on whose behalf the Connection is being madepassword
- - the user's passwordjava.sql.SQLException
- - if a database-access error occurs.public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.DataSource
java.sql.SQLException
- - if a database-access error occurs.public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
setLogWriter
in interface javax.sql.DataSource
out
- - the new log writer; to disable, set to nulljava.sql.SQLException
- - if a database-access error occurs.public void setLoginTimeout(int seconds) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.DataSource
seconds
- - the data source login time limitjava.sql.SQLException
- - if a database access error occurs.public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.DataSource
java.sql.SQLException
- - if a database access error occurs.public void connectionClosed(javax.sql.ConnectionEvent event)
connectionClosed
in interface javax.sql.ConnectionEventListener
event
- - an event object describing the source of the eventpublic void connectionErrorOccurred(javax.sql.ConnectionEvent event)
connectionErrorOccurred
in interface javax.sql.ConnectionEventListener
event
- - an event object describing the source of the eventpublic javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
- If a naming exception was encountered while
retrieving the reference.public static ConnectionManager getConnectionManager(java.lang.String dsname)
public void closeAllConnection()
public static org.objectweb.transaction.api.ResourceManagerEventListener getResourceManagerEventListener()
public java.lang.Integer getCurrentNumberOfJDBCConnectionOpen()
getCurrentNumberOfJDBCConnectionOpen
in interface JmxDataSourceMBean
public java.lang.String getDSName()
getDSName
in interface JmxDataSourceMBean
public void setDSName(java.lang.String s)
s
- Jndi name of the datasourcepublic java.lang.String getDatasourceName()
getDatasourceName
in interface JmxDataSourceMBean
public void setDatasourceName(java.lang.String s)
s
- datasource namepublic java.lang.String getDataSourceFactory()
getDataSourceFactory
in interface JmxDataSourceMBean
public void setDataSourceXADataName(java.lang.String xaName)
the
- DataSourceXANamepublic java.lang.String getDataSourceXADataName()
getDataSourceXADataName
in interface JmxDataSourceMBean
public java.lang.Integer getJDBCConnCheckLevel()
getJDBCConnCheckLevel
in interface JmxDataSourceMBean
public void setJDBCConnCheckLevel(java.lang.Integer level)
setJDBCConnCheckLevel
in interface JmxDataSourceMBean
connection
- levelpublic java.lang.Integer getJDBCConnMaxAge()
getJDBCConnMaxAge
in interface JmxDataSourceMBean
public void setJDBCConnMaxAge(java.lang.Integer age)
setJDBCConnMaxAge
in interface JmxDataSourceMBean
connection
- max agepublic java.lang.String getJDBCTestStatement()
getJDBCTestStatement
in interface JmxDataSourceMBean
public void setJDBCTestStatement(java.lang.String test)
setJDBCTestStatement
in interface JmxDataSourceMBean
test
- statementpublic java.lang.String getDataSourceType()
getDataSourceType
in interface JmxDataSourceMBean
public java.lang.String getDataSourceDescription()
getDataSourceDescription
in interface JmxDataSourceMBean
public void setDataSourceDescription(java.lang.String dsDesc)
the
- desrciption of this datasourcepublic java.lang.Integer getJDBCMinConnPool()
getJDBCMinConnPool
in interface JmxDataSourceMBean
public void setJDBCMinConnPool(java.lang.Integer min)
setJDBCMinConnPool
in interface JmxDataSourceMBean
min
- public java.lang.Integer getJDBCMaxConnPool()
getJDBCMaxConnPool
in interface JmxDataSourceMBean
public void setJDBCMaxConnPool(java.lang.Integer max)
setJDBCMaxConnPool
in interface JmxDataSourceMBean
max
- public java.lang.Integer getJDBCSleepTimeOut()
getJDBCSleepTimeOut
in interface JmxDataSourceMBean
public void setJDBCSleepTimeOut(java.lang.Integer timeOut)
setJDBCSleepTimeOut
in interface JmxDataSourceMBean
timeout
- public java.lang.Integer getJDBCDeadLockPool()
getJDBCDeadLockPool
in interface JmxDataSourceMBean
public void setJDBCDeadLockPool(java.lang.Integer size)
setJDBCDeadLockPool
in interface JmxDataSourceMBean
size
- public java.lang.Integer getJDBCLoopWaitPool()
getJDBCLoopWaitPool
in interface JmxDataSourceMBean
public void setJDBCLoopWaitPool(java.lang.Integer size)
setJDBCLoopWaitPool
in interface JmxDataSourceMBean
size
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |