public class DelegatingDataSource extends ObjectSE implements DataSourceSE, InitializingBean
DataSourceSE に委譲する JDBC DataSourceSE 実装。 このクラスはサブクラス化されることを意図しており、サブクラスは、単にターゲット DataSource に委譲するべきではないメソッド(getConnection() など)のみをオーバーライドします。
getConnection()| コンストラクターと説明 |
|---|
DelegatingDataSource() 新しい DelegatingDataSource を作成します。 |
DelegatingDataSource(DataSourceSE targetDataSource) 新しい DelegatingDataSource を作成します。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | afterPropertiesSet() |
ConnectionSE | getConnection() |
ConnectionSE | getConnection(StringSE username, StringSE password) |
int | getLoginTimeout() |
PrintWriterSE | getLogWriter() |
LoggerSE | getParentLogger() |
DataSourceSE | getTargetDataSource() この DataSource が委譲するターゲット DataSource を返します。 |
boolean | isWrapperFor(ClassSE<?> iface) |
protected DataSourceSE | obtainTargetDataSource() 実際に使用するためにターゲット DataSource を取得します(決して null ではありません)。 |
void | setLoginTimeout(int seconds) |
void | setLogWriter(PrintWriterSE out) |
void | setTargetDataSource(DataSourceSE targetDataSource) この DataSource が委譲するターゲット DataSource を設定します。 |
<T> T | unwrap(ClassSE<T> iface) |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic DelegatingDataSource()
public DelegatingDataSource(DataSourceSE targetDataSource)
targetDataSource - ターゲット DataSourcepublic void setTargetDataSource(@Nullable DataSourceSE targetDataSource)
@Nullable public DataSourceSE getTargetDataSource()
protected DataSourceSE obtainTargetDataSource()
DataSource を取得します(決して null ではありません)。public void afterPropertiesSet()
InitializingBeanBeanFactoryAware、ApplicationContextAware などを満たした後、包含 BeanFactory によって呼び出されます。このメソッドにより、Bean インスタンスは、すべての Bean プロパティが設定されたときに、その全体的な構成の検証と最終的な初期化を実行できます。
InitializingBean 内の afterPropertiesSet public ConnectionSE getConnection() throws SQLExceptionSE
DataSourceSE 内の getConnectionSE SQLExceptionSEpublic ConnectionSE getConnection(StringSE username, StringSE password) throws SQLExceptionSE
DataSourceSE 内の getConnectionSE SQLExceptionSEpublic PrintWriterSE getLogWriter() throws SQLExceptionSE
CommonDataSourceSE 内の getLogWriterSE SQLExceptionSEpublic void setLogWriter(PrintWriterSE out) throws SQLExceptionSE
CommonDataSourceSE 内の setLogWriterSE SQLExceptionSEpublic int getLoginTimeout()
throws SQLExceptionSECommonDataSourceSE 内の getLoginTimeoutSE SQLExceptionSEpublic void setLoginTimeout(int seconds)
throws SQLExceptionSECommonDataSourceSE 内の setLoginTimeoutSE SQLExceptionSEpublic <T> T unwrap(ClassSE<T> iface) throws SQLExceptionSE
WrapperSE 内の unwrapSE SQLExceptionSEpublic boolean isWrapperFor(ClassSE<?> iface) throws SQLExceptionSE
WrapperSE 内の isWrapperForSE SQLExceptionSEpublic LoggerSE getParentLogger()
CommonDataSourceSE 内の getParentLoggerSE