@Bean(name="dataSource", parent=Kernel.class, active=true, exportable=true) @ConfigType(value={DefaultMode,SessionManagerMode,ConnectionManagersMode,ComponentMode}) public class DataSourceBean extends MDPoolBean<DataSource,DataSourceBean.DataSourceMDConfigBean> implements ComponentStatisticsProvider
| Modifier and Type | Class and Description |
|---|---|
static class |
DataSourceBean.DataSourceChangedEvent
|
static class |
DataSourceBean.DataSourceMDConfigBean |
POOL_CLASS, POOL_SIZE, REPO_CLASS, REPO_URI| Constructor and Description |
|---|
DataSourceBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRepo(String domain,
DataSource repo)
Add data source instance to the pool
|
protected ScheduledFuture |
addWatchdogTask(Runnable task,
Duration frequency) |
boolean |
belongsTo(Class<? extends BasicComponent> component) |
void |
everyHour() |
void |
everyMinute() |
void |
everySecond() |
Class<? extends DataSourceBean.DataSourceMDConfigBean> |
getConfigClass()
Returns per domain configuration class
|
Set<String> |
getDataSourceNames()
Retrieve list of all available data source names
|
Class<?> |
getDefaultBeanClass()
Returns default class for all bean which are defined using configuration as subbeans of bean implementing this
interface.
|
DataSource |
getRepository(String name)
Retrieves data source for provided name
|
void |
getStatistics(String compName,
StatisticsList list) |
DataSource |
removeRepo(String domain)
Remove data source from the pool
|
protected void |
removeWatchdogTask(ScheduledFuture scheduledFuture) |
void |
setDefault(DataSource repo)
Method called to set default repo instance.
|
getDefaultAlias, getName, register, registerConfigBean, unregisterpublic DataSource getRepository(String name)
name - of data source to retrievepublic Class<? extends DataSourceBean.DataSourceMDConfigBean> getConfigClass()
MDPoolBeangetConfigClass in class MDPoolBean<DataSource,DataSourceBean.DataSourceMDConfigBean>public void addRepo(String domain, DataSource repo)
addRepo in class MDPoolBean<DataSource,DataSourceBean.DataSourceMDConfigBean>domain - name of data sourcerepo - instance of data sourcepublic DataSource removeRepo(String domain)
removeRepo in class MDPoolBean<DataSource,DataSourceBean.DataSourceMDConfigBean>domain - name of data sourcepublic Set<String> getDataSourceNames()
public void setDefault(DataSource repo)
MDPoolBeansetDefault in class MDPoolBean<DataSource,DataSourceBean.DataSourceMDConfigBean>repo - instance of repopublic boolean belongsTo(Class<? extends BasicComponent> component)
belongsTo in interface ComponentStatisticsProviderpublic void everyHour()
everyHour in interface ComponentStatisticsProviderpublic void everyMinute()
everyMinute in interface ComponentStatisticsProviderpublic void everySecond()
everySecond in interface ComponentStatisticsProviderpublic void getStatistics(String compName, StatisticsList list)
getStatistics in interface StatisticsProviderIfcpublic Class<?> getDefaultBeanClass()
RegistrarBeanWithDefaultBeanClassgetDefaultBeanClass in interface RegistrarBeanWithDefaultBeanClassprotected ScheduledFuture addWatchdogTask(Runnable task, Duration frequency)
protected void removeWatchdogTask(ScheduledFuture scheduledFuture)
Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.