Package tigase.db.beans
Class DataSourceBean.DataSourceMDConfigBean
- java.lang.Object
-
- tigase.db.beans.MDPoolConfigBean<DataSource,DataSourceBean.DataSourceMDConfigBean>
-
- tigase.db.beans.DataSourceBean.DataSourceMDConfigBean
-
- All Implemented Interfaces:
ConfigurationChangedAware,Initializable,RegistrarBean,UnregisterAware
- Enclosing class:
- DataSourceBean
public static class DataSourceBean.DataSourceMDConfigBean extends MDPoolConfigBean<DataSource,DataSourceBean.DataSourceMDConfigBean> implements UnregisterAware
-
-
Constructor Summary
Constructors Constructor Description DataSourceMDConfigBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeUnregister()Method called before bean unregister.protected java.lang.Class<? extends DataSource>getRepositoryIfc()Get interface to which all instances in this pool must conform.protected java.lang.StringgetRepositoryPoolClassName()Finds and retrieves repository pool class name for data source defined in this config bean.voidinitialize()Method will be called, when bean will be created, configured and ready to use.protected voidinitRepository(DataSource repo)Initializes instances of provided data source.voidsetWatchdogFrequency(java.time.Duration watchdogFrequency)-
Methods inherited from class tigase.db.beans.MDPoolConfigBean
beanConfigurationChanged, getRepository, getRepositoryClassName, getUri, register, setInstances, setMdPool, setRepository, unloadOldBeans, unregister
-
-
-
-
Method Detail
-
setWatchdogFrequency
public void setWatchdogFrequency(java.time.Duration watchdogFrequency)
-
initialize
public void initialize()
Description copied from interface:InitializableMethod will be called, when bean will be created, configured and ready to use.- Specified by:
initializein interfaceInitializable- Overrides:
initializein classMDPoolConfigBean<DataSource,DataSourceBean.DataSourceMDConfigBean>
-
beforeUnregister
public void beforeUnregister()
Description copied from interface:UnregisterAwareMethod called before bean unregister.- Specified by:
beforeUnregisterin interfaceUnregisterAware
-
getRepositoryIfc
protected java.lang.Class<? extends DataSource> getRepositoryIfc()
Get interface to which all instances in this pool must conform.- Specified by:
getRepositoryIfcin classMDPoolConfigBean<DataSource,DataSourceBean.DataSourceMDConfigBean>- Returns:
- interface `
-
getRepositoryPoolClassName
protected java.lang.String getRepositoryPoolClassName() throws DBInitExceptionFinds and retrieves repository pool class name for data source defined in this config bean. *
Name of a pool class will be retrieved frompoolClsfield or looked for instances ofDataSourcePoolclass annotated withRepository.Metawhich supported uri matches (regexp) of data source URI.- Specified by:
getRepositoryPoolClassNamein classMDPoolConfigBean<DataSource,DataSourceBean.DataSourceMDConfigBean>- Returns:
- name of a class
- Throws:
DBInitException
-
initRepository
protected void initRepository(DataSource repo) throws RepositoryException
Initializes instances of provided data source.- Specified by:
initRepositoryin classMDPoolConfigBean<DataSource,DataSourceBean.DataSourceMDConfigBean>- Parameters:
repo- instance of data source- Throws:
RepositoryException
-
-