public class CmsDataSource extends MultiDataSource
限定符和类型 | 字段和说明 |
---|---|
private static CmsDataSource |
cmsDataSource |
static java.lang.String |
DATABASE_CONFIG_FILENAME |
static java.lang.String |
DATABASE_CONFIG_TEMPLATE |
private java.util.Map<java.lang.Object,java.lang.Object> |
dataSources |
private java.lang.String |
dbconfigFilePath |
static java.lang.String |
DEFAULT_DATABASE_NAME |
private static boolean |
initialized |
构造器和说明 |
---|
CmsDataSource(java.lang.String filepath) |
限定符和类型 | 方法和说明 |
---|---|
void |
afterPropertiesSet() |
boolean |
contains(java.lang.Object name) |
static javax.sql.DataSource |
getDataSource(java.util.Properties properties) |
void |
init() |
static void |
initDefaultDataSource() |
static java.util.Properties |
loadDatabaseConfig(java.lang.String configFilePath) |
void |
put(java.lang.Object name,
java.lang.Object dataSource) |
void |
remove(java.lang.Object name) |
determineCurrentLookupKey, getDataSourceName, resetDataSourceName, setDataSourceName
determineTargetDataSource, getConnection, getConnection, getResolvedDataSources, getResolvedDefaultDataSource, isWrapperFor, resolveSpecifiedDataSource, resolveSpecifiedLookupKey, setDataSourceLookup, setDefaultTargetDataSource, setLenientFallback, setTargetDataSources, unwrap
public static final java.lang.String DATABASE_CONFIG_FILENAME
public static final java.lang.String DEFAULT_DATABASE_NAME
public static final java.lang.String DATABASE_CONFIG_TEMPLATE
private static volatile CmsDataSource cmsDataSource
private java.lang.String dbconfigFilePath
private static boolean initialized
private java.util.Map<java.lang.Object,java.lang.Object> dataSources
public static java.util.Properties loadDatabaseConfig(java.lang.String configFilePath) throws java.io.FileNotFoundException, java.io.IOException
configFilePath
- java.io.FileNotFoundException
java.io.IOException
public static javax.sql.DataSource getDataSource(java.util.Properties properties) throws java.io.IOException, java.beans.PropertyVetoException
properties
- java.io.IOException
java.beans.PropertyVetoException
public static void initDefaultDataSource()
public void afterPropertiesSet()
afterPropertiesSet
在接口中 org.springframework.beans.factory.InitializingBean
afterPropertiesSet
在类中 org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
public void init()
public void put(java.lang.Object name, java.lang.Object dataSource)
name
- dataSource
- public void remove(java.lang.Object name)
name
- public boolean contains(java.lang.Object name)
name
-