public abstract class AbstractSimonDataSource extends Object
Modifier and Type | Field and Description |
---|---|
protected SimonConnectionConfiguration |
configuration |
protected PrintWriter |
logWriter |
Constructor and Description |
---|
AbstractSimonDataSource() |
Modifier and Type | Method and Description |
---|---|
protected <T> T |
createDataSource(Class<T> dataSourceClass)
Instantiates the DataSource.
|
protected abstract String |
doGetRealDataSourceClassName()
Reads DataSource class name from configuration.
|
int |
getLoginTimeout()
Gets the maximum time in seconds that this data source can wait
while attempting to connect to a database.
|
PrintWriter |
getLogWriter()
Retrieves the log writer for this
DataSource object. |
String |
getPassword()
Returns database password to authenticate connection.
|
String |
getPrefix()
Returns Simon prefix for constructing names of Simons.
|
Properties |
getProperties()
Get properties specific to the real datasource.
|
String |
getRealDataSourceClassName()
Returns real datasource class name.
|
String |
getRealUrl()
Returns real JDBC connection URL.
|
String |
getUrl()
Returns JDBC connection URL.
|
String |
getUser()
Returns database user to authenticate connection.
|
void |
setLoginTimeout(int seconds)
Sets the maximum time in seconds that this data source will wait
while attempting to connect to a database.
|
void |
setLogWriter(PrintWriter out)
Sets the log writer for this
DataSource object to the given java.io.PrintWriter object. |
void |
setPassword(String password)
Setter for password property.
|
void |
setPrefix(String prefix)
Sets Simon prefix for constructing names of Simons.
|
void |
setProperties(Properties properties)
Set properties specific to the real datasource.
|
void |
setRealDataSourceClassName(String className)
Setter for realDataSourceClassName property.
|
void |
setUrl(String url)
Setter for URL property.
|
void |
setUser(String user)
Setter for user property.
|
protected transient PrintWriter logWriter
protected SimonConnectionConfiguration configuration
public AbstractSimonDataSource()
public final PrintWriter getLogWriter() throws SQLException
DataSource
object.SQLException
- if a database access error occursCommonDataSource.getLogWriter()
,
setLogWriter(java.io.PrintWriter)
public final void setLogWriter(PrintWriter out) throws SQLException
DataSource
object to the given java.io.PrintWriter
object.out
- the new log writer; to disable logging, set to nullSQLException
- if a database access error occursCommonDataSource.setLogWriter(java.io.PrintWriter)
,
getLogWriter()
public final void setUrl(String url)
url
- JDBC connection URLpublic final String getRealUrl()
public final String getUser()
public final void setUser(String user)
user
- database userpublic final String getPassword()
public final void setPassword(String password)
password
- database passwordpublic final void setLoginTimeout(int seconds) throws SQLException
DataSource
object is created, the login timeout is
initially zero.seconds
- the data source login time limitSQLException
- if a database access error occurs.getLoginTimeout()
public final int getLoginTimeout() throws SQLException
DataSource
object is created, the login timeout is
initially zero.SQLException
- if a database access error occurs.setLoginTimeout(int)
public final String getRealDataSourceClassName()
public final void setRealDataSourceClassName(String className)
className
- class name of real datasourceprotected final <T> T createDataSource(Class<T> dataSourceClass) throws SQLException
T
- DataSource typedataSourceClass
- Expected DataSource classSQLException
protected abstract String doGetRealDataSourceClassName()
public final String getPrefix()
public final void setPrefix(String prefix)
prefix
- Simon prefixpublic Properties getProperties()
public void setProperties(Properties properties)
Copyright © 2019. All rights reserved.