src
This commit is contained in:
@@ -417,6 +417,7 @@ public class SourceModuleEngine extends ModuleEngine implements SourceManager {
|
|||||||
public DataSource loadDataSource(final String sourceName, boolean autoMemory) {
|
public DataSource loadDataSource(final String sourceName, boolean autoMemory) {
|
||||||
dataSourceLock.lock();
|
dataSourceLock.lock();
|
||||||
try {
|
try {
|
||||||
|
long st = System.currentTimeMillis();
|
||||||
DataSource old = resourceFactory.find(sourceName, DataSource.class);
|
DataSource old = resourceFactory.find(sourceName, DataSource.class);
|
||||||
if (old != null) {
|
if (old != null) {
|
||||||
return old;
|
return old;
|
||||||
@@ -433,7 +434,7 @@ public class SourceModuleEngine extends ModuleEngine implements SourceManager {
|
|||||||
}
|
}
|
||||||
dataSources.add(source);
|
dataSources.add(source);
|
||||||
resourceFactory.register(sourceName, DataSource.class, source);
|
resourceFactory.register(sourceName, DataSource.class, source);
|
||||||
logger.info("Load DataSource resourceName = '" + sourceName + "', source = " + source);
|
logger.info("Load DataSource resourceName = '" + sourceName + "', source = " + source + " in " + (System.currentTimeMillis() - st) + " ms");
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
if (!sourceConf.getValue(DataSources.DATA_SOURCE_RESOURCE, "").isEmpty()) {
|
if (!sourceConf.getValue(DataSources.DATA_SOURCE_RESOURCE, "").isEmpty()) {
|
||||||
@@ -473,7 +474,7 @@ public class SourceModuleEngine extends ModuleEngine implements SourceManager {
|
|||||||
resourceFactory.register(sourceName, DataJdbcSource.class, source);
|
resourceFactory.register(sourceName, DataJdbcSource.class, source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("Load DataSource resourceName = '" + sourceName + "', source = " + source);
|
logger.info("Load DataSource resourceName = '" + sourceName + "', source = " + source + " in " + (System.currentTimeMillis() - st) + " ms");
|
||||||
return source;
|
return source;
|
||||||
} catch (RuntimeException ex) {
|
} catch (RuntimeException ex) {
|
||||||
throw ex;
|
throw ex;
|
||||||
|
|||||||
Reference in New Issue
Block a user