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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beanConfigurationChanged
(Collection<String> changedFields) Method called when configuration was applied to bean.protected A
protected String
Get class name to initialize as repositoryGet interface to which instances initialized by this config bean must conform to.protected abstract String
Get name of a pool which should be used if any.protected String
getUri()
void
Method will be called, when bean will be created, configured and ready to use.protected abstract void
initRepository
(A repo) Method used to initialize provided instancevoid
Method called when bean is being registered allowing developer to programatically register other beans.void
setInstances
(Set<A> instances) void
setMdPool
(MDPoolBean<A, B> mdPool) void
setRepository
(A repo) void
void
unregister
(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:ConfigurationChangedAware
Method called when configuration was applied to bean.- Specified by:
beanConfigurationChanged
in interfaceConfigurationChangedAware
- Parameters:
changedFields
- collection of field names which were changed
-
unloadOldBeans
public void unloadOldBeans() -
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
-
register
Description copied from interface:RegistrarBean
Method called when bean is being registered allowing developer to programatically register other beans.- Specified by:
register
in interfaceRegistrarBean
- Parameters:
kernel
- - instance from local scope
-
unregister
Description copied from interface:RegistrarBean
Method called while bean is being unregistered.- Specified by:
unregister
in 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
-