public abstract class MDPoolConfigBean<A,B extends MDPoolConfigBean<A,B>> extends Object implements Initializable, ConfigurationChangedAware, RegistrarBean
DataSourceBean
, AuthRepositoryMDPoolBean
and UserRepositoryMDPoolBean
Modifier and Type | Field and Description |
---|---|
protected String |
cls |
protected MDPoolBean<A,B> |
mdPool |
protected String |
name |
protected String |
poolCls |
protected int |
poolSize |
protected String |
uri |
Constructor and Description |
---|
MDPoolConfigBean() |
Modifier and Type | Method and Description |
---|---|
void |
beanConfigurationChanged(Collection<String> changedFields)
Method called when configuration was applied to bean.
|
protected A |
getRepository() |
protected String |
getRepositoryClassName()
Get class name to initialize as repository
|
protected abstract Class<? extends A> |
getRepositoryIfc()
Get interface to which instances initialized by this config bean must conform to.
|
protected abstract String |
getRepositoryPoolClassName()
Get name of a pool which should be used if any.
|
protected String |
getUri() |
void |
initialize()
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 instance
|
void |
register(Kernel kernel)
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 |
unloadOldBeans() |
void |
unregister(Kernel kernel)
Method called while bean is being unregistered.
|
@ConfigField(alias="repo-class", desc="Class implementing repository", allowAliasFromParent=false) protected String cls
@Inject protected MDPoolBean<A,B extends MDPoolConfigBean<A,B>> mdPool
@ConfigField(desc="Name (ie. domain)") protected String name
@ConfigField(alias="pool-class", desc="Class implementing repository pool", allowAliasFromParent=false) protected String poolCls
@ConfigField(alias="pool-size", desc="Pool size", allowAliasFromParent=false) protected int poolSize
@ConfigField(alias="repo-uri", desc="URI for repository", allowAliasFromParent=false) protected String uri
public void beanConfigurationChanged(Collection<String> changedFields)
ConfigurationChangedAware
beanConfigurationChanged
in interface ConfigurationChangedAware
changedFields
- collection of field names which were changedpublic void unloadOldBeans()
public void initialize()
Initializable
initialize
in interface Initializable
public void register(Kernel kernel)
RegistrarBean
register
in interface RegistrarBean
kernel
- - instance from local scopepublic void unregister(Kernel kernel)
RegistrarBean
unregister
in interface RegistrarBean
kernel
- - instance from local scopepublic void setMdPool(MDPoolBean<A,B> mdPool)
protected abstract Class<? extends A> getRepositoryIfc()
protected abstract String getRepositoryPoolClassName() throws DBInitException
DBInitException
protected abstract void initRepository(A repo) throws RepositoryException
RepositoryException
protected String getRepositoryClassName() throws DBInitException
DBInitException
protected String getUri()
protected A getRepository()
public void setRepository(A repo)
Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.