OWNER - 所属持久化容器类型DATASOURCE_CONFIG - 数据源配置类型CONNECTION - 连接类型public abstract class AbstractDataSourceAdapter<OWNER extends IPersistence,DATASOURCE_CONFIG extends IDataSourceConfig,CONNECTION> extends Object implements IDataSourceAdapter<OWNER,DATASOURCE_CONFIG,CONNECTION>
| Constructor and Description |
|---|
AbstractDataSourceAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected String |
decryptPasswordIfNeed() |
protected String |
decryptPasswordIfNeed(String password) |
protected abstract void |
doClose()
由子类实现具体关闭逻辑
|
protected abstract void |
doInitialize(OWNER owner,
DATASOURCE_CONFIG dataSourceConfig)
由子类实现具体初始化逻辑
|
DATASOURCE_CONFIG |
getDataSourceConfig()
获取数据源配置
|
OWNER |
getOwner()
获取所属持久化模块
|
void |
initialize(OWNER owner,
DATASOURCE_CONFIG dataSourceConfig)
数据源适配器初始化
|
boolean |
initializeIfNeed()
判断是否已初始化, 若尚未执行则尝试初始化
|
protected boolean |
isInitialized() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConnectionpublic void initialize(OWNER owner, DATASOURCE_CONFIG dataSourceConfig) throws Exception
IDataSourceAdapterinitialize in interface IDataSourceAdapter<OWNER extends IPersistence,DATASOURCE_CONFIG extends IDataSourceConfig,CONNECTION>owner - 所属拥有者对象dataSourceConfig - 数据源配置参数Exception - 可能产生的异常public OWNER getOwner()
IDataSourceAdaptergetOwner in interface IDataSourceAdapter<OWNER extends IPersistence,DATASOURCE_CONFIG extends IDataSourceConfig,CONNECTION>protected abstract void doInitialize(OWNER owner, DATASOURCE_CONFIG dataSourceConfig) throws Exception
owner - 所属容器参数对象dataSourceConfig - 数据源配置对象Exception - 可能产生的任何异常public boolean initializeIfNeed()
throws Exception
IDataSourceAdapterinitializeIfNeed in interface IDataSourceAdapter<OWNER extends IPersistence,DATASOURCE_CONFIG extends IDataSourceConfig,CONNECTION>Exception - 可能产生的异常public DATASOURCE_CONFIG getDataSourceConfig()
IDataSourceAdaptergetDataSourceConfig in interface IDataSourceAdapter<OWNER extends IPersistence,DATASOURCE_CONFIG extends IDataSourceConfig,CONNECTION>public void close()
throws Exception
close in interface AutoCloseableExceptionprotected abstract void doClose()
throws Exception
Exception - 可能产生的任何异常protected boolean isInitialized()
Copyright © 2022. All rights reserved.