public abstract class InstanceKeyDataSource extends Object implements DataSource, Referenceable, Serializable
The base class for SharedPoolDataSource
and
PerUserPoolDataSource
.
Modifier and Type | Field and Description |
---|---|
protected String |
instanceKey
Instance key
|
protected static int |
UNKNOWN_TRANSACTIONISOLATION
Internal constant to indicate the level is not set.
|
Constructor and Description |
---|
InstanceKeyDataSource() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParentLogger
protected static final int UNKNOWN_TRANSACTIONISOLATION
protected String instanceKey
protected void assertInitializationAllowed() throws IllegalStateException
IllegalStateException
protected abstract org.datanucleus.store.rdbms.datasource.dbcp.datasources.PooledConnectionManager getConnectionManager(org.datanucleus.store.rdbms.datasource.dbcp.datasources.UserPassKey upkey)
public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
in interface Wrapper
SQLException
public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
SQLException
public ConnectionPoolDataSource getConnectionPoolDataSource()
public void setConnectionPoolDataSource(ConnectionPoolDataSource v)
public String getDataSourceName()
public void setDataSourceName(String v)
public boolean isDefaultAutoCommit()
public void setDefaultAutoCommit(boolean v)
public boolean isDefaultReadOnly()
public void setDefaultReadOnly(boolean v)
public int getDefaultTransactionIsolation()
public void setDefaultTransactionIsolation(int v)
public String getDescription()
public void setDescription(String v)
public int getLoginTimeout()
getLoginTimeout
in interface CommonDataSource
public void setLoginTimeout(int v)
setLoginTimeout
in interface CommonDataSource
public PrintWriter getLogWriter()
getLogWriter
in interface CommonDataSource
public void setLogWriter(PrintWriter v)
setLogWriter
in interface CommonDataSource
public final boolean isTestOnBorrow()
public boolean getTestOnBorrow()
public void setTestOnBorrow(boolean testOnBorrow)
public final boolean isTestOnReturn()
public boolean getTestOnReturn()
public void setTestOnReturn(boolean testOnReturn)
public int getTimeBetweenEvictionRunsMillis()
public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis)
public int getNumTestsPerEvictionRun()
public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
public int getMinEvictableIdleTimeMillis()
public void setMinEvictableIdleTimeMillis(int minEvictableIdleTimeMillis)
public final boolean isTestWhileIdle()
public boolean getTestWhileIdle()
public void setTestWhileIdle(boolean testWhileIdle)
public String getValidationQuery()
public void setValidationQuery(String validationQuery)
public boolean isRollbackAfterValidation()
public void setRollbackAfterValidation(boolean rollbackAfterValidation)
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
protected abstract org.datanucleus.store.rdbms.datasource.dbcp.datasources.PooledConnectionAndInfo getPooledConnectionAndInfo(String username, String password) throws SQLException
SQLException
protected abstract void setupDefaults(Connection con, String username) throws SQLException
SQLException
protected ConnectionPoolDataSource testCPDS(String username, String password) throws NamingException, SQLException
NamingException
SQLException
protected byte whenExhaustedAction(int maxActive, int maxWait)
public Reference getReference() throws NamingException
getReference
in interface Referenceable
NamingException
Copyright © 2017. All rights reserved.