PropertiesAgent加强注释

This commit is contained in:
Redkale
2022-11-24 22:31:18 +08:00
parent 0b2f2b189c
commit 949498f3a7
2 changed files with 19 additions and 1 deletions

View File

@@ -23,14 +23,31 @@ public abstract class PropertiesAgent {
public static final String PROP_NAMESPACE_APPLICATION = "application";
/**
* 编译时进行的操作
*
* @param conf 节点配置
*/
public void compile(AnyValue conf) {
}
/**
* 初始化配置源配置项需要写入appProperties并监听配置项的变化
*
* @param factory 依赖注入资源工厂
* @param appProperties 全局property.开头的配置项
* @param conf 节点配置
*/
public abstract void init(ResourceFactory factory, Properties appProperties, AnyValue conf);
/**
* 销毁动作
*
* @param conf 节点配置
*/
public abstract void destroy(AnyValue conf);
protected String getKeyResourceName(String key) {
return key.startsWith("property.") ? key : ("property." + key);
return key.startsWith("system.property.") || key.startsWith("property.") ? key : ("property." + key);
}
}

View File

@@ -839,6 +839,7 @@ public final class ResourceFactory {
this.elements = new CopyOnWriteArrayList<>();
}
//wrappers=null时才会触发listener的ResourceChangeEvent事件
public ResourceEntry(final String name, T value, final List<ResourceElement> elements, List<ResourceChangeWrapper> wrappers, boolean sync) {
this.name = name;
this.value = value;