@Context @EachProperty(value="datasources", primary="default") public class DatasourceConfiguration extends org.apache.commons.dbcp2.BasicDataSource implements BasicJdbcConfiguration
BasicDataSource
are available to be configured.
If the url, driver class, username, or password are missing, sensible defaults
will be provided when possible. If no configuration beyond the datasource name
is provided, an in memory datastore will be configured based on the available
drivers on the classpath.PREFIX
Constructor and Description |
---|
DatasourceConfiguration(java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getConfiguredDriverClassName() |
java.lang.String |
getConfiguredPassword() |
java.lang.String |
getConfiguredUrl() |
java.lang.String |
getConfiguredUsername() |
java.lang.String |
getConfiguredValidationQuery() |
java.lang.String |
getDriverClassName() |
java.lang.String |
getName()
Get the name of the bean.
|
java.lang.String |
getPassword() |
java.lang.String |
getUrl() |
java.lang.String |
getUsername() |
java.lang.String |
getValidationQuery() |
void |
setDataSourceProperties(java.util.Map<java.lang.String,?> dsProperties)
Sets the datasource properties.
|
addConnectionProperty, close, createConnectionFactory, createConnectionPool, createDataSource, createDataSourceInstance, createObjectPool, createPoolableConnectionFactory, evict, getAbandonedLogWriter, getAbandonedUsageTracking, getAutoCommitOnReturn, getCacheState, getConnection, getConnection, getConnectionFactoryClassName, getConnectionInitSqls, getConnectionInitSqlsAsArray, getConnectionPool, getDefaultAutoCommit, getDefaultCatalog, getDefaultQueryTimeout, getDefaultReadOnly, getDefaultSchema, getDefaultTransactionIsolation, getDisconnectionSqlCodes, getDisconnectionSqlCodesAsArray, getDriver, getDriverClassLoader, getEnableAutoCommitOnReturn, getEvictionPolicyClassName, getFastFailValidation, getInitialSize, getJmxName, getLifo, getLogAbandoned, getLogExpiredConnections, getLoginTimeout, getLogWriter, getMaxConnLifetimeMillis, getMaxIdle, getMaxOpenPreparedStatements, getMaxTotal, getMaxWaitMillis, getMinEvictableIdleTimeMillis, getMinIdle, getNumActive, getNumIdle, getNumTestsPerEvictionRun, getParentLogger, getRegisteredJmxName, getRemoveAbandonedOnBorrow, getRemoveAbandonedOnMaintenance, getRemoveAbandonedTimeout, getRollbackOnReturn, getSoftMinEvictableIdleTimeMillis, getTestOnBorrow, getTestOnCreate, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, getValidationQueryTimeout, invalidateConnection, isAccessToUnderlyingConnectionAllowed, isClosed, isPoolPreparedStatements, isWrapperFor, log, log, postDeregister, postRegister, preDeregister, preRegister, removeConnectionProperty, setAbandonedLogWriter, setAbandonedUsageTracking, setAccessToUnderlyingConnectionAllowed, setAutoCommitOnReturn, setCacheState, setConnectionFactoryClassName, setConnectionInitSqls, setConnectionProperties, setDefaultAutoCommit, setDefaultCatalog, setDefaultQueryTimeout, setDefaultReadOnly, setDefaultSchema, setDefaultTransactionIsolation, setDisconnectionSqlCodes, setDriver, setDriverClassLoader, setDriverClassName, setEnableAutoCommitOnReturn, setEvictionPolicyClassName, setFastFailValidation, setInitialSize, setJmxName, setLifo, setLogAbandoned, setLogExpiredConnections, setLoginTimeout, setLogWriter, setMaxConnLifetimeMillis, setMaxIdle, setMaxOpenPreparedStatements, setMaxTotal, setMaxWaitMillis, setMinEvictableIdleTimeMillis, setMinIdle, setNumTestsPerEvictionRun, setPassword, setPoolPreparedStatements, setRemoveAbandonedOnBorrow, setRemoveAbandonedOnMaintenance, setRemoveAbandonedTimeout, setRollbackOnReturn, setSoftMinEvictableIdleTimeMillis, setTestOnBorrow, setTestOnCreate, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis, setUrl, setUsername, setValidationQuery, setValidationQueryTimeout, startPoolMaintenance, unwrap, validateConnectionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setDriverClassName, setPassword, setUrl, setUsername
public DatasourceConfiguration(@Parameter java.lang.String name)
name
- name configured from propertiespublic java.lang.String getName()
getName
in interface BasicJdbcConfiguration
public java.lang.String getDriverClassName()
getDriverClassName
in interface BasicJdbcConfiguration
getDriverClassName
in interface org.apache.commons.dbcp2.BasicDataSourceMXBean
getDriverClassName
in class org.apache.commons.dbcp2.BasicDataSource
public java.lang.String getConfiguredDriverClassName()
getConfiguredDriverClassName
in interface BasicJdbcConfiguration
public java.lang.String getUrl()
getUrl
in interface BasicJdbcConfiguration
getUrl
in interface org.apache.commons.dbcp2.BasicDataSourceMXBean
getUrl
in class org.apache.commons.dbcp2.BasicDataSource
public java.lang.String getConfiguredUrl()
getConfiguredUrl
in interface BasicJdbcConfiguration
public java.lang.String getUsername()
getUsername
in interface BasicJdbcConfiguration
getUsername
in interface org.apache.commons.dbcp2.BasicDataSourceMXBean
getUsername
in class org.apache.commons.dbcp2.BasicDataSource
public java.lang.String getConfiguredUsername()
getConfiguredUsername
in interface BasicJdbcConfiguration
public java.lang.String getPassword()
getPassword
in interface BasicJdbcConfiguration
getPassword
in interface org.apache.commons.dbcp2.BasicDataSourceMXBean
getPassword
in class org.apache.commons.dbcp2.BasicDataSource
public java.lang.String getConfiguredPassword()
getConfiguredPassword
in interface BasicJdbcConfiguration
public java.lang.String getValidationQuery()
getValidationQuery
in interface BasicJdbcConfiguration
getValidationQuery
in interface org.apache.commons.dbcp2.BasicDataSourceMXBean
getValidationQuery
in class org.apache.commons.dbcp2.BasicDataSource
public void setDataSourceProperties(@MapFormat(transformation=FLAT,keyFormat=RAW) java.util.Map<java.lang.String,?> dsProperties)
BasicJdbcConfiguration
setDataSourceProperties
in interface BasicJdbcConfiguration
dsProperties
- The propertiespublic java.lang.String getConfiguredValidationQuery()
getConfiguredValidationQuery
in interface BasicJdbcConfiguration