org.objectweb.jonas.dbm
Class JDBCDataSource
java.lang.Object
javax.management.NotificationBroadcasterSupport
org.objectweb.jonas.management.ReconfigDispatcher
org.objectweb.jonas.management.j2eemanagement.J2EEManagedObject
org.objectweb.jonas.dbm.JDBCDataSource
- All Implemented Interfaces:
- javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, ReconfigDispatcherMBean
public class JDBCDataSource
- extends J2EEManagedObject
MBean class for JDBCDataSource Management
This MBean manages a connection manager and its associated pool. This couple
represents the JOnAS data source implementation
- Author:
- Eric Hardesty JSR 77 (J2EE Management Standard), Adriana Danes add support for persistent reconfiguration
Methods inherited from class javax.management.NotificationBroadcasterSupport |
handleNotification, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JDBCDataSource
public JDBCDataSource(java.lang.String objectName,
ConnectionManager cm)
- Parameters:
objectName
- This MBean's OBJECT_NAMEcm
- Associated ConnectionManager reference
getJdbcDriver
public java.lang.String getJdbcDriver()
- Returns:
- The OBJECT_NAME of the associated JDBCDriver MBean
setJdbcDriver
public void setJdbcDriver(java.lang.String jdbcDriverObjectName)
- Parameters:
jdbcDriverObjectName
- OBJECT_NAME of the associated JDBCDriver MBean
getName
public java.lang.String getName()
- Return the current data source name. Returns the local attribute value (optimize
call) - this value can't be changed, moreover, its used by private methods.
- Returns:
- The current data source name
getJndiName
public java.lang.String getJndiName()
- Returns:
- The JNDI name
getDescription
public java.lang.String getDescription()
- Returns:
- Description of this data source
getUrl
public java.lang.String getUrl()
- Returns:
- The JDBC URL for the database
getUserName
public java.lang.String getUserName()
- Returns:
- The user name for connection to the database
getUserPassword
public java.lang.String getUserPassword()
- Returns:
- The password for connection to the database
getMapperName
public java.lang.String getMapperName()
- Returns:
- The mapper JORM for the database
getJdbcConnCheckLevel
public java.lang.Integer getJdbcConnCheckLevel()
- Returns:
- JDBC connection checking level
setJdbcConnCheckLevel
public void setJdbcConnCheckLevel(java.lang.Integer level)
- Sets the JDBC connection checking level
- Parameters:
level
- connection level
getJdbcConnMaxAge
public java.lang.Integer getJdbcConnMaxAge()
- Returns:
- JDBC connections maximum age
setJdbcConnMaxAge
public void setJdbcConnMaxAge(java.lang.Integer mn)
- Parameters:
mn
- JDBC connections maximum age
getJdbcMaxConnPool
public java.lang.Integer getJdbcMaxConnPool()
- Returns:
- max maximum size of JDBC connection pool
setJdbcMaxConnPool
public void setJdbcMaxConnPool(java.lang.Integer max)
- Parameters:
max
- maximum size of JDBC connection pool
getJdbcMaxOpenTime
public java.lang.Integer getJdbcMaxOpenTime()
- Returns:
- maximum opening time of JDBC connections
setJdbcMaxOpenTime
public void setJdbcMaxOpenTime(java.lang.Integer mn)
- Parameters:
mn
- maximum opening time in minutes for JDBC connections
getJdbcMaxWaiters
public java.lang.Integer getJdbcMaxWaiters()
- Returns:
- maximum nb of waiters allowed
setJdbcMaxWaiters
public void setJdbcMaxWaiters(java.lang.Integer max)
- Parameters:
max
- maximum nb of waiters allowed
getJdbcMaxWaitTime
public java.lang.Integer getJdbcMaxWaitTime()
- Returns:
- maximum time to wait for a connection, in seconds
setJdbcMaxWaitTime
public void setJdbcMaxWaitTime(java.lang.Integer max)
- Parameters:
max
- maximum time to wait for a connection, in seconds
getJdbcPstmtMax
public java.lang.Integer getJdbcPstmtMax()
- Returns:
- PreparedStatement cache size
setJdbcPstmtMax
public void setJdbcPstmtMax(java.lang.Integer max)
- Parameters:
max
- PreparedStatement cache size
getJdbcMinConnPool
public java.lang.Integer getJdbcMinConnPool()
- Returns:
- minimum size of connection pool
setJdbcMinConnPool
public void setJdbcMinConnPool(java.lang.Integer min)
- MBean method allowing to set the minimum size of connection pool
- Parameters:
min
- minimum size of connection pool
getJdbcSamplingPeriod
public java.lang.Integer getJdbcSamplingPeriod()
- Returns:
- sampling period for refresching pool statistics
setJdbcSamplingPeriod
public void setJdbcSamplingPeriod(java.lang.Integer i)
- Parameters:
i
- sampling period for refresching pool statistics
getJdbcTestStatement
public java.lang.String getJdbcTestStatement()
- Returns:
- SQL query for JDBC connections test
setJdbcTestStatement
public java.lang.String setJdbcTestStatement(java.lang.String test)
- Parameters:
test
- SQL query for JDBC connection test
- Returns:
- the test statement if the test succeeded, an error message otherwise
getConnectionFailures
public java.lang.Integer getConnectionFailures()
- Returns:
- number of connection failures
getConnectionLeaks
public java.lang.Integer getConnectionLeaks()
- Returns:
- number of connection leaks
getCurrentBusy
public java.lang.Integer getCurrentBusy()
- Returns:
- number of busy connections
getBusyMax
public java.lang.Integer getBusyMax()
- Returns:
- number of busy connections
getBusyMin
public java.lang.Integer getBusyMin()
- Returns:
- number of busy connections
getCurrentInTx
public java.lang.Integer getCurrentInTx()
- Returns:
- number of connections used in transactions
getCurrentOpened
public java.lang.Integer getCurrentOpened()
- Returns:
- number of opened connections
getCurrentWaiters
public java.lang.Integer getCurrentWaiters()
- Returns:
- current number of connection waiters
getOpenedCount
public java.lang.Integer getOpenedCount()
- Returns:
- number of opened physical JDBC connections
getRejectedFull
public java.lang.Integer getRejectedFull()
- Returns:
- number of open calls that were rejected because too many waiters
getRejectedOpen
public java.lang.Integer getRejectedOpen()
- Returns:
- total number of open calls that were rejected
getRejectedOther
public java.lang.Integer getRejectedOther()
- Returns:
- number of open calls that were rejected by an unknown reason
getRejectedTimeout
public java.lang.Integer getRejectedTimeout()
- Returns:
- number of open calls that were rejected by timeout
getServedOpen
public java.lang.Integer getServedOpen()
- Returns:
- number of xa connection served
getWaiterCount
public java.lang.Integer getWaiterCount()
- Returns:
- total number of waiters since datasource creation.
getWaitersHigh
public java.lang.Integer getWaitersHigh()
- Returns:
- Maximum number of waiters since datasource creation.
getWaitersHighRecent
public java.lang.Integer getWaitersHighRecent()
- Returns:
- Maximum nb of waiters in last sampling period
getWaitingHigh
public java.lang.Long getWaitingHigh()
- Returns:
- Maximum waiting time (millisec) since datasource creation.
getWaitingHighRecent
public java.lang.Long getWaitingHighRecent()
- Returns:
- Maximum waiting time (millisec) in last sampling period
getWaitingTime
public java.lang.Long getWaitingTime()
- Returns:
- Total waiting time (millisec) since datasource creation.
getSequenceNumber
protected long getSequenceNumber()
- Gets the sequence number for reconfiguration opeartions
- Returns:
- the sequence number for reconfiguration operations
saveConfig
public void saveConfig()
- save updated configuration