@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, unregister
public DataSource getRepository(String name)
name
- of data source to retrievepublic Class<? extends DataSourceBean.DataSourceMDConfigBean> getConfigClass()
MDPoolBean
getConfigClass
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)
MDPoolBean
setDefault
in class MDPoolBean<DataSource,DataSourceBean.DataSourceMDConfigBean>
repo
- instance of repopublic boolean belongsTo(Class<? extends BasicComponent> component)
belongsTo
in interface ComponentStatisticsProvider
public void everyHour()
everyHour
in interface ComponentStatisticsProvider
public void everyMinute()
everyMinute
in interface ComponentStatisticsProvider
public void everySecond()
everySecond
in interface ComponentStatisticsProvider
public void getStatistics(String compName, StatisticsList list)
getStatistics
in interface StatisticsProviderIfc
public Class<?> getDefaultBeanClass()
RegistrarBeanWithDefaultBeanClass
getDefaultBeanClass
in interface RegistrarBeanWithDefaultBeanClass
protected ScheduledFuture addWatchdogTask(Runnable task, Duration frequency)
protected void removeWatchdogTask(ScheduledFuture scheduledFuture)
Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.