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
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Method called before bean unregister.protected Class<? extends DataSource>
Get interface to which all instances in this pool must conform.protected String
Finds and retrieves repository pool class name for data source defined in this config bean.void
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
(Duration watchdogFrequency) Methods inherited from class tigase.db.beans.MDPoolConfigBean
beanConfigurationChanged, getRepository, getRepositoryClassName, getUri, register, setInstances, setMdPool, setRepository, unloadOldBeans, unregister
-
Constructor Details
-
DataSourceMDConfigBean
public DataSourceMDConfigBean()
-
-
Method Details
-
setWatchdogFrequency
-
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
Get interface to which all instances in this pool must conform.- Specified by:
getRepositoryIfc
in classMDPoolConfigBean<DataSource,
DataSourceBean.DataSourceMDConfigBean> - Returns:
- interface `
-
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.- Specified by:
getRepositoryPoolClassName
in classMDPoolConfigBean<DataSource,
DataSourceBean.DataSourceMDConfigBean> - Returns:
- name of a class
- Throws:
DBInitException
-
initRepository
Initializes instances of provided data source.- Specified by:
initRepository
in classMDPoolConfigBean<DataSource,
DataSourceBean.DataSourceMDConfigBean> - Parameters:
repo
- instance of data source- Throws:
RepositoryException
-