public class NamedDataSourceSelector extends Object implements DataSourceSelector
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NAME |
Constructor and Description |
---|
NamedDataSourceSelector(HighAvailableDataSource highAvailableDataSource) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroy the DataSourceSelector, maybe interrupt the Thread.
|
DataSource |
get()
Return a DataSource according to the implemention.
|
String |
getDefaultName() |
String |
getName()
Return the name of this DataSourceSelector.
|
String |
getTarget() |
void |
init()
Init the DataSourceSelector before use it.
|
void |
resetDataSourceName() |
void |
setDefaultName(String defaultName) |
void |
setTarget(String name)
Set the target DataSource name to return.
|
public static final String DEFAULT_NAME
public NamedDataSourceSelector(HighAvailableDataSource highAvailableDataSource)
public void init()
DataSourceSelector
init
in interface DataSourceSelector
public void destroy()
DataSourceSelector
destroy
in interface DataSourceSelector
public String getName()
DataSourceSelector
getName
in interface DataSourceSelector
public DataSource get()
DataSourceSelector
get
in interface DataSourceSelector
public void setTarget(String name)
DataSourceSelector
setTarget
in interface DataSourceSelector
public String getTarget()
public void resetDataSourceName()
public String getDefaultName()
public void setDefaultName(String defaultName)
Copyright © 2013–2021 Alibaba Group. All rights reserved.