Package tigase.db.beans
Class MDPoolConfigBean<A,B extends MDPoolConfigBean<A,B>>
java.lang.Object
tigase.db.beans.MDPoolConfigBean<A,B>
- All Implemented Interfaces:
ConfigurationChangedAware,Initializable,RegistrarBean
- Direct Known Subclasses:
AuthUserRepositoryConfigBean,DataSourceBean.DataSourceMDConfigBean
public abstract class MDPoolConfigBean<A,B extends MDPoolConfigBean<A,B>>
extends Object
implements Initializable, ConfigurationChangedAware, RegistrarBean
Base class for configuration beans of
Created by andrzej on 08.03.2016.
DataSourceBean, AuthRepositoryMDPoolBean and UserRepositoryMDPoolBean
Created by andrzej on 08.03.2016.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeanConfigurationChanged(Collection<String> changedFields) Method called when configuration was applied to bean.protected Aprotected StringGet class name to initialize as repositoryGet interface to which instances initialized by this config bean must conform to.protected abstract StringGet name of a pool which should be used if any.protected StringgetUri()voidMethod will be called, when bean will be created, configured and ready to use.protected abstract voidinitRepository(A repo) Method used to initialize provided instancevoidMethod called when bean is being registered allowing developer to programatically register other beans.voidsetInstances(Set<A> instances) voidsetMdPool(MDPoolBean<A, B> mdPool) voidsetRepository(A repo) voidvoidunregister(Kernel kernel) Method called while bean is being unregistered.
-
Field Details
-
cls
@ConfigField(alias="repo-class", desc="Class implementing repository", allowAliasFromParent=false) protected String cls -
mdPool
-
name
-
poolCls
@ConfigField(alias="pool-class", desc="Class implementing repository pool", allowAliasFromParent=false) protected String poolCls -
poolSize
@ConfigField(alias="pool-size", desc="Pool size", allowAliasFromParent=false) protected int poolSize -
uri
@ConfigField(alias="repo-uri", desc="URI for repository", allowAliasFromParent=false, type=JdbcUrl) protected String uri
-
-
Constructor Details
-
MDPoolConfigBean
public MDPoolConfigBean()
-
-
Method Details
-
beanConfigurationChanged
Description copied from interface:ConfigurationChangedAwareMethod called when configuration was applied to bean.- Specified by:
beanConfigurationChangedin interfaceConfigurationChangedAware- Parameters:
changedFields- collection of field names which were changed
-
unloadOldBeans
public void unloadOldBeans() -
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
-
register
Description copied from interface:RegistrarBeanMethod called when bean is being registered allowing developer to programatically register other beans.- Specified by:
registerin interfaceRegistrarBean- Parameters:
kernel- - instance from local scope
-
unregister
Description copied from interface:RegistrarBeanMethod called while bean is being unregistered.- Specified by:
unregisterin interfaceRegistrarBean- Parameters:
kernel- - instance from local scope
-
setInstances
-
setMdPool
-
getRepositoryIfc
Get interface to which instances initialized by this config bean must conform to.- Returns:
- interface
-
getRepositoryPoolClassName
Get name of a pool which should be used if any.- Returns:
- class name
- Throws:
DBInitException
-
initRepository
Method used to initialize provided instance- Throws:
RepositoryException
-
getRepositoryClassName
Get class name to initialize as repository- Throws:
DBInitException
-
getUri
-
getRepository
-
setRepository
-