org.apache.tomcat.jdbc.pool
Class DataSource
java.lang.Object
org.apache.tomcat.jdbc.pool.DataSourceProxy
org.apache.tomcat.jdbc.pool.DataSource
- All Implemented Interfaces:
- java.sql.Wrapper, javax.management.MBeanRegistration, javax.sql.CommonDataSource, javax.sql.ConnectionPoolDataSource, javax.sql.DataSource, ConnectionPoolMBean, PoolConfiguration
- Direct Known Subclasses:
- XADataSource
public class DataSource
- extends DataSourceProxy
- implements javax.sql.DataSource, javax.management.MBeanRegistration, ConnectionPoolMBean, javax.sql.ConnectionPoolDataSource
A DataSource that can be instantiated through IoC and implements the DataSource interface
since the DataSourceProxy is used as a generic proxy.
The DataSource simply wraps a ConnectionPool
in order to provide a standard interface to the user.
- Version:
- 1.0
- Author:
- Filip Hanik
Field Summary |
protected javax.management.ObjectName |
oname
|
Method Summary |
javax.management.ObjectName |
createObjectName(javax.management.ObjectName original)
Creates the ObjectName for the ConnectionPoolMBean object to be registered |
void |
postDeregister()
Unregisters the underlying connection pool mbean. |
void |
postRegister(java.lang.Boolean registrationDone)
no-op
|
void |
preDeregister()
no-op
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
If the connection pool MBean exists, it will be registered during this operation. |
protected void |
registerJmx()
Registers the ConnectionPoolMBean under a unique name based on the ObjectName for the DataSource |
protected void |
unregisterJmx()
|
Methods inherited from class org.apache.tomcat.jdbc.pool.DataSourceProxy |
checkAbandoned, checkIdle, close, close, createPool, getAbandonWhenPercentageFull, getActive, getCommitOnReturn, getConnection, getConnection, getConnectionAsync, getConnectionProperties, getDataSource, getDataSourceJNDI, getDbProperties, getDefaultAutoCommit, getDefaultCatalog, getDefaultReadOnly, getDefaultTransactionIsolation, getDriverClassName, getIdle, getInitialSize, getInitSQL, getJdbcInterceptors, getJdbcInterceptorsAsArray, getLoginTimeout, getLogValidationErrors, getLogWriter, getMaxActive, getMaxAge, getMaxIdle, getMaxWait, getMinEvictableIdleTimeMillis, getMinIdle, getName, getNumActive, getNumIdle, getNumTestsPerEvictionRun, getParentLogger, getPassword, getPool, getPooledConnection, getPooledConnection, getPoolName, getPoolProperties, getPoolSize, getPropagateInterruptState, getRemoveAbandonedTimeout, getRollbackOnReturn, getSize, getSuspectTimeout, getTimeBetweenEvictionRunsMillis, getUrl, getUseDisposableConnectionFacade, getUseLock, getUsername, getValidationInterval, getValidationQuery, getValidator, getValidatorClassName, getWaitCount, getXAConnection, getXAConnection, isAccessToUnderlyingConnectionAllowed, isAlternateUsernameAllowed, isDefaultAutoCommit, isDefaultReadOnly, isFairQueue, isJmxEnabled, isLogAbandoned, isPoolSweeperEnabled, isRemoveAbandoned, isTestOnBorrow, isTestOnConnect, isTestOnReturn, isTestWhileIdle, isUseEquals, isWrapperFor, purge, purgeOnReturn, setAbandonWhenPercentageFull, setAccessToUnderlyingConnectionAllowed, setAlternateUsernameAllowed, setCommitOnReturn, setConnectionProperties, setDataSource, setDataSourceJNDI, setDbProperties, setDefaultAutoCommit, setDefaultCatalog, setDefaultReadOnly, setDefaultTransactionIsolation, setDriverClassName, setFairQueue, setInitialSize, setInitSQL, setJdbcInterceptors, setJmxEnabled, setLogAbandoned, setLoginTimeout, setLogValidationErrors, setLogWriter, setMaxActive, setMaxAge, setMaxIdle, setMaxWait, setMinEvictableIdleTimeMillis, setMinIdle, setName, setNumTestsPerEvictionRun, setPassword, setPoolProperties, setPropagateInterruptState, setRemoveAbandoned, setRemoveAbandonedTimeout, setRollbackOnReturn, setSuspectTimeout, setTestOnBorrow, setTestOnConnect, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis, setUrl, setUseDisposableConnectionFacade, setUseEquals, setUseLock, setUsername, setValidationInterval, setValidationQuery, setValidator, setValidatorClassName, testIdle, toString, unwrap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.sql.DataSource |
getConnection, getConnection |
Methods inherited from interface java.sql.Wrapper |
isWrapperFor, unwrap |
Methods inherited from interface org.apache.tomcat.jdbc.pool.jmx.ConnectionPoolMBean |
checkAbandoned, checkIdle, getActive, getIdle, getNumActive, getNumIdle, getSize, getWaitCount, purge, purgeOnReturn, testIdle |
Methods inherited from interface org.apache.tomcat.jdbc.pool.PoolConfiguration |
getAbandonWhenPercentageFull, getCommitOnReturn, getConnectionProperties, getDataSource, getDataSourceJNDI, getDbProperties, getDefaultAutoCommit, getDefaultCatalog, getDefaultReadOnly, getDefaultTransactionIsolation, getDriverClassName, getInitialSize, getInitSQL, getJdbcInterceptors, getJdbcInterceptorsAsArray, getLogValidationErrors, getMaxActive, getMaxAge, getMaxIdle, getMaxWait, getMinEvictableIdleTimeMillis, getMinIdle, getName, getNumTestsPerEvictionRun, getPassword, getPoolName, getPropagateInterruptState, getRemoveAbandonedTimeout, getRollbackOnReturn, getSuspectTimeout, getTimeBetweenEvictionRunsMillis, getUrl, getUseDisposableConnectionFacade, getUseLock, getUsername, getValidationInterval, getValidationQuery, getValidator, getValidatorClassName, isAccessToUnderlyingConnectionAllowed, isAlternateUsernameAllowed, isDefaultAutoCommit, isDefaultReadOnly, isFairQueue, isJmxEnabled, isLogAbandoned, isPoolSweeperEnabled, isRemoveAbandoned, isTestOnBorrow, isTestOnConnect, isTestOnReturn, isTestWhileIdle, isUseEquals, setAbandonWhenPercentageFull, setAccessToUnderlyingConnectionAllowed, setAlternateUsernameAllowed, setCommitOnReturn, setConnectionProperties, setDataSource, setDataSourceJNDI, setDbProperties, setDefaultAutoCommit, setDefaultCatalog, setDefaultReadOnly, setDefaultTransactionIsolation, setDriverClassName, setFairQueue, setInitialSize, setInitSQL, setJdbcInterceptors, setJmxEnabled, setLogAbandoned, setLogValidationErrors, setMaxActive, setMaxAge, setMaxIdle, setMaxWait, setMinEvictableIdleTimeMillis, setMinIdle, setName, setNumTestsPerEvictionRun, setPassword, setPropagateInterruptState, setRemoveAbandoned, setRemoveAbandonedTimeout, setRollbackOnReturn, setSuspectTimeout, setTestOnBorrow, setTestOnConnect, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis, setUrl, setUseDisposableConnectionFacade, setUseEquals, setUseLock, setUsername, setValidationInterval, setValidationQuery, setValidator, setValidatorClassName |
Methods inherited from interface javax.sql.ConnectionPoolDataSource |
getPooledConnection, getPooledConnection |
Methods inherited from interface javax.sql.CommonDataSource |
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter |
oname
protected volatile javax.management.ObjectName oname
DataSource
public DataSource()
- Constructor for reflection only. A default set of pool properties will be created.
DataSource
public DataSource(PoolConfiguration poolProperties)
- Constructs a DataSource object wrapping a connection
- Parameters:
poolProperties
-
postDeregister
public void postDeregister()
- Unregisters the underlying connection pool mbean.
- Specified by:
postDeregister
in interface javax.management.MBeanRegistration
postRegister
public void postRegister(java.lang.Boolean registrationDone)
- no-op
- Specified by:
postRegister
in interface javax.management.MBeanRegistration
preDeregister
public void preDeregister()
throws java.lang.Exception
- no-op
- Specified by:
preDeregister
in interface javax.management.MBeanRegistration
- Throws:
java.lang.Exception
preRegister
public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws java.lang.Exception
- If the connection pool MBean exists, it will be registered during this operation.
- Specified by:
preRegister
in interface javax.management.MBeanRegistration
- Throws:
java.lang.Exception
createObjectName
public javax.management.ObjectName createObjectName(javax.management.ObjectName original)
throws javax.management.MalformedObjectNameException
- Creates the ObjectName for the ConnectionPoolMBean object to be registered
- Parameters:
original
- the ObjectName for the DataSource
- Returns:
- the ObjectName for the ConnectionPoolMBean
- Throws:
javax.management.MalformedObjectNameException
registerJmx
protected void registerJmx()
- Registers the ConnectionPoolMBean under a unique name based on the ObjectName for the DataSource
unregisterJmx
protected void unregisterJmx()
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.