Browse Source

REPORT-80940 IOFileAttrMark接口问题

【问题原因】插件启用后未刷新
【改动思路】插件启用后刷新;修改AttrMap中key标签
【review建议】
security/10.0
Leo.Qin 2 years ago
parent
commit
1dc48debd7
  1. 33
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

33
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -446,13 +446,10 @@ public class HistoryTemplateListCache implements CallbackEvent {
for (int i = 0; i < size; i++) {
JTemplate<?, ?> template = historyList.get(i);
FILE file = template.getEditingFILE();
boolean needReload = context == null || needReloadTemplate(context, template);
if (needReload) {
FILE stashFile = template.templateToStashFile();
if (stashFile != null) {
FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName());
template.refreshResource(stashFile);
}
FILE stashFile = template.templateToStashFile();
if (stashFile != null) {
FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName());
template.refreshResource(stashFile);
}
}
FineLoggerFactory.getLogger().info("Plugin env change reload all template ended");
@ -474,28 +471,6 @@ public class HistoryTemplateListCache implements CallbackEvent {
_reloadAllEditingTemplate(null);
}
private boolean needReloadTemplate(PluginContext context, JTemplate<?, ?> template) {
BaseBook baseBook = template.getTarget();
if (baseBook != null) {
String name = template.getEditingFILE().getName();
String pluginId = context.getID();
long start = System.currentTimeMillis();
Set<ClassLoader> set = ClassHelper.getClassLoadersByFilter(baseBook, ClassFilter.getInstance());
FineLoggerFactory.getLogger().info("{} find plugin classloader spend: {} ms", name, (System.currentTimeMillis() - start));
if (set != null) {
for (ClassLoader classLoader : set) {
if (ComparatorUtils.equals(pluginId, PluginManager.detectLeakingPlugin(classLoader))) {
return true;
}
}
} else {
// set为null说明 检测classloader 这里返回true直接刷新 兜底行为
return true;
}
}
return false;
}
public void replaceCurrentEditingTemplate(JTemplate<?, ?> jt) {
int index = contains(this.editingTemplate);
this.editingTemplate = jt;

Loading…
Cancel
Save