|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dellroad.stuff.schema.AbstractUpdatingDataSource
public abstract class AbstractUpdatingDataSource
A DataSource that wraps an inner DataSource and automatically performs some update
operation on the inner DataSource on first access.
The dataSource property is required.
| Constructor Summary | |
|---|---|
AbstractUpdatingDataSource()
|
|
| Method Summary | ||
|---|---|---|
Connection |
getConnection()
|
|
Connection |
getConnection(String username,
String password)
|
|
protected DataSource |
getInnerDataSource()
Get the underlying DataSource. |
|
int |
getLoginTimeout()
|
|
PrintWriter |
getLogWriter()
|
|
protected boolean |
isUpdated()
Determine if the underlying DataSource has been updated. |
|
boolean |
isWrapperFor(Class<?> cl)
|
|
void |
setDataSource(DataSource dataSource)
Configure the underlying DataSource. |
|
void |
setLoginTimeout(int timeout)
|
|
void |
setLogWriter(PrintWriter pw)
|
|
|
unwrap(Class<T> cl)
|
|
protected abstract void |
updateDataSource(DataSource dataSource)
Update the inner DataSource. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractUpdatingDataSource()
| Method Detail |
|---|
public void setDataSource(DataSource dataSource)
DataSource. Required property.
protected abstract void updateDataSource(DataSource dataSource)
throws SQLException
DataSource.
This method will be invoked at most once.
SQLExceptionprotected DataSource getInnerDataSource()
DataSource.
protected boolean isUpdated()
DataSource has been updated.
If the update is currently happening in another thread, the current thread will block until the update operation finishes.
public Connection getConnection()
throws SQLException
getConnection in interface DataSourceSQLException
public Connection getConnection(String username,
String password)
throws SQLException
getConnection in interface DataSourceSQLException
public PrintWriter getLogWriter()
throws SQLException
getLogWriter in interface CommonDataSourceSQLException
public void setLogWriter(PrintWriter pw)
throws SQLException
setLogWriter in interface CommonDataSourceSQLException
public void setLoginTimeout(int timeout)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLException
public int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLException
public <T> T unwrap(Class<T> cl)
throws SQLException
unwrap in interface WrapperSQLException
public boolean isWrapperFor(Class<?> cl)
throws SQLException
isWrapperFor in interface WrapperSQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||