Class StickyRandomDataSourceSelector
- java.lang.Object
-
- com.alibaba.druid.pool.ha.selector.RandomDataSourceSelector
-
- com.alibaba.druid.pool.ha.selector.StickyRandomDataSourceSelector
-
- All Implemented Interfaces:
DataSourceSelector
public class StickyRandomDataSourceSelector extends RandomDataSourceSelector
An extend selector based on RandomDataSourceSelector which can stick a DataSource to a Thread in a while.- Author:
- DigitalSonic
- See Also:
RandomDataSourceSelector,StickyDataSourceHolder
-
-
Field Summary
-
Fields inherited from class com.alibaba.druid.pool.ha.selector.RandomDataSourceSelector
PROP_BLACKLIST_THRESHOLD, PROP_CHECKING_INTERVAL, PROP_RECOVERY_INTERVAL, PROP_VALIDATION_SLEEP
-
-
Constructor Summary
Constructors Constructor Description StickyRandomDataSourceSelector(HighAvailableDataSource highAvailableDataSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataSourceget()Return a DataSource according to the implemention.intgetExpireSeconds()StringgetName()Return the name of this DataSourceSelector.voidsetExpireSeconds(int expireSeconds)-
Methods inherited from class com.alibaba.druid.pool.ha.selector.RandomDataSourceSelector
addBlacklist, containInBlacklist, destroy, getBlacklist, getBlacklistThreshold, getCheckingIntervalSeconds, getDataSourceMap, getFullDataSourceMap, getHighAvailableDataSource, getRecoverThread, getRecoveryIntervalSeconds, getValidateThread, getValidationSleepSeconds, init, removeBlacklist, setBlacklistThreshold, setCheckingIntervalSeconds, setRecoverThread, setRecoveryIntervalSeconds, setTarget, setValidateThread, setValidationSleepSeconds
-
-
-
-
Constructor Detail
-
StickyRandomDataSourceSelector
public StickyRandomDataSourceSelector(HighAvailableDataSource highAvailableDataSource)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:DataSourceSelectorReturn the name of this DataSourceSelector. e.g. byName- Specified by:
getNamein interfaceDataSourceSelector- Overrides:
getNamein classRandomDataSourceSelector
-
get
public DataSource get()
Description copied from interface:DataSourceSelectorReturn a DataSource according to the implemention.- Specified by:
getin interfaceDataSourceSelector- Overrides:
getin classRandomDataSourceSelector
-
getExpireSeconds
public int getExpireSeconds()
-
setExpireSeconds
public void setExpireSeconds(int expireSeconds)
-
-