|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.commons.dbcp.BasicDataSource
org.apache.commons.dbcp.ManagedBasicDataSource
public class ManagedBasicDataSource
Wrapper for BasicDataSource that exposes some fields and methods as a MBean.
| Field Summary | |
|---|---|
static String |
DEFAULT_MBEAN_NAME
The default auto-generated unique name for the exposed MBean. |
protected String |
mBeanName
The name under which this object is exposed to the MBean server. |
| Fields inherited from class org.apache.commons.dbcp.BasicDataSource |
|---|
closed, connectionInitSqls, connectionPool, connectionProperties, dataSource, defaultAutoCommit, defaultCatalog, defaultReadOnly, defaultTransactionIsolation, driverClassLoader, driverClassName, initialSize, logWriter, maxActive, maxIdle, maxOpenPreparedStatements, maxWait, minEvictableIdleTimeMillis, minIdle, numTestsPerEvictionRun, password, poolPreparedStatements, testOnBorrow, testOnReturn, testWhileIdle, timeBetweenEvictionRunsMillis, url, username, validationQuery, validationQueryTimeout |
| Constructor Summary | |
|---|---|
ManagedBasicDataSource()
Build a new instance of ManagedBasicDataSource and expose it as a MBean with an auto-generated unique name. |
|
ManagedBasicDataSource(MBeanServer mBeanServer,
String mBeanName)
Build a new instance of ManagedBasicDataSource and expose it as a MBean with the specified name. |
|
ManagedBasicDataSource(String mBeanName)
Build a new instance of ManagedBasicDataSource and expose it as a MBean with the specified name. |
|
| Method Summary | ||
|---|---|---|
protected void |
exportMBean(MBeanServer mBeanServer,
String name)
Export this object as a MBean to the platform default MBean server. |
|
int |
getMaxActive()
Get the maximum number of active connections that can be allocated at the same time. |
|
int |
getMaxIdle()
Get the maximum number of connections that can remain idle in the pool. |
|
long |
getMaxWait()
Get the maximum number of milliseconds that the pool will wait for a connection to be returned before throwing an exception. |
|
String |
getMBeanName()
Get the name under which this object is exposed to the MBean server. |
|
int |
getMinIdle()
Get the minimum number of idle connections in the pool. |
|
int |
getNumActive()
Get the current number of active connections that have been allocated from this data source. |
|
int |
getNumIdle()
Get the current number of idle connections that are waiting to be allocated from this data source. |
|
String |
getUrl()
Get the JDBC connection BasicDataSource.url property. |
|
String |
getUsername()
Get the JDBC connection BasicDataSource.username property. |
|
boolean |
isWrapperFor(Class<?> iface)
|
|
void |
setMaxActive(int maxActive)
Set the maximum number of active connections that can be allocated at the same time. |
|
void |
setMaxIdle(int maxIdle)
Set the maximum number of connections that can remain idle in the pool. |
|
void |
setMaxWait(long maxWait)
Set the maxWait property. |
|
void |
setMinIdle(int minIdle)
Set the minimum number of idle connections in the pool. |
|
|
unwrap(Class<T> iface)
|
|
| Methods inherited from class org.apache.commons.dbcp.BasicDataSource |
|---|
addConnectionProperty, close, createConnectionFactory, createConnectionPool, createDataSource, createDataSourceInstance, createPoolableConnectionFactory, getConnection, getConnection, getConnectionInitSqls, getDefaultAutoCommit, getDefaultCatalog, getDefaultReadOnly, getDefaultTransactionIsolation, getDriverClassLoader, getDriverClassName, getInitialSize, getLogAbandoned, getLoginTimeout, getLogWriter, getMaxOpenPreparedStatements, getMinEvictableIdleTimeMillis, getNumTestsPerEvictionRun, getPassword, getRemoveAbandoned, getRemoveAbandonedTimeout, getTestOnBorrow, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, getValidationQuery, getValidationQueryTimeout, isAccessToUnderlyingConnectionAllowed, isClosed, isPoolPreparedStatements, log, removeConnectionProperty, setAccessToUnderlyingConnectionAllowed, setConnectionInitSqls, setConnectionProperties, setDefaultAutoCommit, setDefaultCatalog, setDefaultReadOnly, setDefaultTransactionIsolation, setDriverClassLoader, setDriverClassName, setInitialSize, setLogAbandoned, setLoginTimeout, setLogWriter, setMaxOpenPreparedStatements, setMinEvictableIdleTimeMillis, setNumTestsPerEvictionRun, setPassword, setPoolPreparedStatements, setRemoveAbandoned, setRemoveAbandonedTimeout, setTestOnBorrow, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis, setUrl, setUsername, setValidationQuery, setValidationQueryTimeout, validateConnectionFactory |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_MBEAN_NAME
protected final String mBeanName
| Constructor Detail |
|---|
public ManagedBasicDataSource()
ManagedBasicDataSource and expose it as a MBean with an auto-generated unique name.
DEFAULT_MBEAN_NAME,
exportMBean(MBeanServer, String)public ManagedBasicDataSource(String mBeanName)
ManagedBasicDataSource and expose it as a MBean with the specified name.
mBeanName - the name of the MBean to expose, should be unique accross the target application.DEFAULT_MBEAN_NAME,
exportMBean(MBeanServer, String)
public ManagedBasicDataSource(MBeanServer mBeanServer,
String mBeanName)
ManagedBasicDataSource and expose it as a MBean with the specified name.
mBeanServer - mBeanName - the name of the MBean to expose, should be unique accross the target application.DEFAULT_MBEAN_NAME,
exportMBean(MBeanServer, String)| Method Detail |
|---|
protected void exportMBean(MBeanServer mBeanServer,
String name)
mBeanServer - name - the name of the MBean to expose.public String getMBeanName()
public boolean isWrapperFor(Class<?> iface)
throws SQLException
isWrapperFor in interface WrapperisWrapperFor in class org.apache.commons.dbcp.BasicDataSourceSQLException
public <T> T unwrap(Class<T> iface)
throws SQLException
unwrap in interface Wrapperunwrap in class org.apache.commons.dbcp.BasicDataSourceSQLExceptionpublic int getNumActive()
getNumActive in class org.apache.commons.dbcp.BasicDataSourcepublic int getNumIdle()
getNumIdle in class org.apache.commons.dbcp.BasicDataSourcepublic int getMaxActive()
A negative number means that there is no limit.
getMaxActive in class org.apache.commons.dbcp.BasicDataSourcepublic void setMaxActive(int maxActive)
setMaxActive in class org.apache.commons.dbcp.BasicDataSourcemaxActive - the new value for maxActive.getMaxActive()public int getMaxIdle()
A negative value indicates that there is no limit.
getMaxIdle in class org.apache.commons.dbcp.BasicDataSourcepublic void setMaxIdle(int maxIdle)
setMaxIdle in class org.apache.commons.dbcp.BasicDataSourcemaxIdle - the new value for maxIdle.getMaxIdle()public int getMinIdle()
getMinIdle in class org.apache.commons.dbcp.BasicDataSourceGenericObjectPool.getMinIdle()public void setMinIdle(int minIdle)
setMinIdle in class org.apache.commons.dbcp.BasicDataSourceminIdle - the new value for minIdle.GenericObjectPool.setMinIdle(int)public long getMaxWait()
A value less than or equal to zero means the pool is set to wait indefinitely.
getMaxWait in class org.apache.commons.dbcp.BasicDataSourcepublic void setMaxWait(long maxWait)
Use -1 to make the pool wait indefinitely.
setMaxWait in class org.apache.commons.dbcp.BasicDataSourcemaxWait - the new value for maxWait.getMaxWait()public String getUrl()
BasicDataSource.url property.
getUrl in class org.apache.commons.dbcp.BasicDataSourceBasicDataSource.url passed to the JDBC driver to establish connections.public String getUsername()
BasicDataSource.username property.
getUsername in class org.apache.commons.dbcp.BasicDataSourceBasicDataSource.username passed to the JDBC driver to establish connections.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||