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