支持redkale.datasource.xxx 和 redkale.cachesource.xxx 配置格式

This commit is contained in:
Redkale
2022-07-12 09:36:05 +08:00
parent 48db5a76b0
commit cd3e5bdd14
3 changed files with 28 additions and 26 deletions

View File

@@ -743,7 +743,8 @@ public final class Application {
if (key == null || value == null) continue;
appProperties.put(key, value);
value = replaceValue(value);
if (key.startsWith("redkale.datasource[") || key.startsWith("redkale.cachesource[")) {
if (key.startsWith("redkale.datasource.") || key.startsWith("redkale.datasource[")
|| key.startsWith("redkale.cachesource.") || key.startsWith("redkale.cachesource[")) {
sourceProperties.put(key, value);
} else if (key.startsWith("system.property.")) {
String propName = key.substring("system.property.".length());
@@ -772,7 +773,8 @@ public final class Application {
if (logger.isLoggable(Level.FINEST)) logger.log(Level.FINEST, "load properties(" + dfload + ") size = " + ps.size());
appProperties.putAll(ps);
ps.forEach((x, y) -> {
if (x.toString().startsWith("redkale.datasource[") || x.toString().startsWith("redkale.cachesource[")) {
if (x.toString().startsWith("redkale.datasource.") || x.toString().startsWith("redkale.datasource[")
|| x.toString().startsWith("redkale.cachesource.") || x.toString().startsWith("redkale.cachesource[")) {
sourceProperties.put(x, replaceValue(y.toString()));
} else {
resourceFactory.register("property." + x, replaceValue(y.toString()));