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 void
beforeUnregister()
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.String
getRepositoryPoolClassName()
Finds and retrieves repository pool class name for data source defined in this config bean. *
Name of a pool class will be retrieved frompoolCls
field or looked for instances ofDataSourcePool
class annotated withRepository.Meta
which supported uri matches (regexp) of data source URI.void
initialize()
Method will be called, when bean will be created, configured and ready to use.protected void
initRepository(DataSource repo)
Initializes instances of provided data source.void
setWatchdogFrequency(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:Initializable
Method will be called, when bean will be created, configured and ready to use.- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classMDPoolConfigBean<DataSource,DataSourceBean.DataSourceMDConfigBean>
-
beforeUnregister
public void beforeUnregister()
Description copied from interface:UnregisterAware
Method called before bean unregister.- Specified by:
beforeUnregister
in interfaceUnregisterAware
-
getRepositoryIfc
protected java.lang.Class<? extends DataSource> getRepositoryIfc()
Get interface to which all instances in this pool must conform.- Specified by:
getRepositoryIfc
in classMDPoolConfigBean<DataSource,DataSourceBean.DataSourceMDConfigBean>
- Returns:
- interface `
-
getRepositoryPoolClassName
protected java.lang.String getRepositoryPoolClassName() throws DBInitException
Finds and retrieves repository pool class name for data source defined in this config bean. *
Name of a pool class will be retrieved frompoolCls
field or looked for instances ofDataSourcePool
class annotated withRepository.Meta
which supported uri matches (regexp) of data source URI.- Specified by:
getRepositoryPoolClassName
in 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:
initRepository
in classMDPoolConfigBean<DataSource,DataSourceBean.DataSourceMDConfigBean>
- Parameters:
repo
- instance of data source- Throws:
RepositoryException
-
-