public class FailOverRouter extends AbstractRouter
Modifier and Type | Class and Description |
---|---|
static class |
FailOverRouter.DataSourceHolder |
static interface |
FailOverRouter.ErrorHandler |
static interface |
FailOverRouter.ExceptionSelector |
class |
FailOverRouter.MySQLExceptionSelector |
class |
FailOverRouter.SQLExceptionSelector |
static interface |
FailOverRouter.Strategy |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_STRATEGY |
Constructor and Description |
---|
FailOverRouter() |
Modifier and Type | Method and Description |
---|---|
javax.sql.DataSource |
getDataSource()
Used by $
RoutedDataSource to get the active data source. |
java.util.Collection<FailOverRouter.DataSourceHolder> |
getDataSources() |
void |
init() |
void |
setDatasourceNames(java.lang.String datasourceNames) |
void |
setDelimiter(java.lang.String delimiter) |
void |
setErrorHandler(java.lang.String errorHandler) |
void |
setErrorHandlerInstance(FailOverRouter.ErrorHandler errorHandler) |
void |
setExceptionSelector(java.lang.String selector) |
void |
setExceptionSelectorInstance(FailOverRouter.ExceptionSelector selector) |
void |
setStrategy(java.lang.String strategy) |
void |
setStrategyInstance(FailOverRouter.Strategy strategy) |
void |
updateDataSources(java.util.Collection<FailOverRouter.DataSourceHolder> ds) |
getJndiResource, getOpenEJBResource
public static final java.lang.String DEFAULT_STRATEGY
public javax.sql.DataSource getDataSource()
Router
RoutedDataSource
to get the active data source.public void init()
public void setDatasourceNames(java.lang.String datasourceNames)
public void setDelimiter(java.lang.String delimiter)
public void setStrategy(java.lang.String strategy)
public void setStrategyInstance(FailOverRouter.Strategy strategy)
public void setExceptionSelectorInstance(FailOverRouter.ExceptionSelector selector)
public void setExceptionSelector(java.lang.String selector)
public void setErrorHandlerInstance(FailOverRouter.ErrorHandler errorHandler)
public void setErrorHandler(java.lang.String errorHandler)
public java.util.Collection<FailOverRouter.DataSourceHolder> getDataSources()
public void updateDataSources(java.util.Collection<FailOverRouter.DataSourceHolder> ds)