From b14234603aa705d3ceab7a88efd990647c5c914f Mon Sep 17 00:00:00 2001 From: DaleLee <1658850308@qq.com> Date: Sun, 8 Dec 2024 11:28:00 +0800 Subject: [PATCH] =?UTF-8?q?feature=20#IAY66T=20=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yomahub/liteflow/core/FlowExecutor.java | 2 +- .../yomahub/liteflow/property/LiteflowConfig.java | 12 ++++++------ .../solon/config/LiteflowAutoConfiguration.java | 2 +- .../liteflow/solon/config/LiteflowProperty.java | 10 +++++----- .../liteflow/springboot/LiteflowProperty.java | 10 +++++----- .../config/LiteflowPropertyAutoConfiguration.java | 2 +- .../liteflow/test/ruleCache/RuleCacheTest.java | 2 +- .../src/test/resources/ruleCache/application.xml | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java b/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java index ec1103e8d..653c652d3 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java @@ -228,7 +228,7 @@ public class FlowExecutor { } // 规则缓存 - if (isStart && liteflowConfig.getEnableRuleCache()) { + if (isStart && liteflowConfig.getRuleCacheEnabled()) { initRuleCache(); } } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfig.java b/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfig.java index a13367421..6efb50101 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfig.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfig.java @@ -114,7 +114,7 @@ public class LiteflowConfig { private Boolean enableNodeInstanceId; // 是否启用规则缓存 - private Boolean enableRuleCache; + private Boolean ruleCacheEnabled; // 规则缓存容量 private Integer ruleCacheCapacity; @@ -488,15 +488,15 @@ public class LiteflowConfig { this.enableNodeInstanceId = enableNodeInstanceId; } - public Boolean getEnableRuleCache() { - if (ObjectUtil.isNull(enableRuleCache)) { + public Boolean getRuleCacheEnabled() { + if (ObjectUtil.isNull(ruleCacheEnabled)) { return Boolean.FALSE; } - return enableRuleCache; + return ruleCacheEnabled; } - public void setEnableRuleCache(Boolean enableRuleCache) { - this.enableRuleCache = enableRuleCache; + public void setRuleCacheEnabled(Boolean ruleCacheEnabled) { + this.ruleCacheEnabled = ruleCacheEnabled; } public Integer getRuleCacheCapacity() { diff --git a/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowAutoConfiguration.java b/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowAutoConfiguration.java index c14d4c11e..932a403c0 100644 --- a/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowAutoConfiguration.java +++ b/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowAutoConfiguration.java @@ -51,7 +51,7 @@ public class LiteflowAutoConfiguration { liteflowConfig.setGlobalThreadPoolQueueSize(property.getGlobalThreadPoolQueueSize()); liteflowConfig.setWhenThreadPoolIsolate(property.getWhenThreadPoolIsolate()); liteflowConfig.setEnableNodeInstanceId(property.isEnableNodeInstanceId()); - liteflowConfig.setEnableRuleCache(property.getRuleCache().getEnabled()); + liteflowConfig.setRuleCacheEnabled(property.getRuleCache().isEnabled()); liteflowConfig.setRuleCacheCapacity(property.getRuleCache().getCapacity()); return liteflowConfig; } diff --git a/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowProperty.java b/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowProperty.java index 1319a8d1a..fc65cac33 100644 --- a/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowProperty.java +++ b/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowProperty.java @@ -102,16 +102,16 @@ public class LiteflowProperty { private boolean enableNodeInstanceId; // 规则缓存配置 - private RuleCache ruleCache; + private RuleCacheProperty ruleCache; - public static class RuleCache { + public static class RuleCacheProperty { // 是否启用规则缓存 private Boolean enabled; // 规则缓存容量 private Integer capacity; - public Boolean getEnabled() { + public Boolean isEnabled() { return enabled; } @@ -369,11 +369,11 @@ public class LiteflowProperty { this.enableNodeInstanceId = enableNodeInstanceId; } - public RuleCache getRuleCache() { + public RuleCacheProperty getRuleCache() { return ruleCache; } - public void setRuleCache(RuleCache ruleCache) { + public void setRuleCache(RuleCacheProperty ruleCache) { this.ruleCache = ruleCache; } } diff --git a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java index bea2a0d4b..6c08c5a4d 100644 --- a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java +++ b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java @@ -102,16 +102,16 @@ public class LiteflowProperty { // 规则缓存配置 @NestedConfigurationProperty - private RuleCache ruleCache; + private RuleCacheProperty ruleCache; - public static class RuleCache { + public static class RuleCacheProperty { // 是否启用规则缓存 private Boolean enabled; // 规则缓存容量 private Integer capacity; - public Boolean getEnabled() { + public Boolean isEnabled() { return enabled; } @@ -360,11 +360,11 @@ public class LiteflowProperty { this.enableNodeInstanceId = enableNodeInstanceId; } - public RuleCache getRuleCache() { + public RuleCacheProperty getRuleCache() { return ruleCache; } - public void setRuleCache(RuleCache ruleCache) { + public void setRuleCache(RuleCacheProperty ruleCache) { this.ruleCache = ruleCache; } } diff --git a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/config/LiteflowPropertyAutoConfiguration.java b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/config/LiteflowPropertyAutoConfiguration.java index 01b9e1afc..71a6756d2 100644 --- a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/config/LiteflowPropertyAutoConfiguration.java +++ b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/config/LiteflowPropertyAutoConfiguration.java @@ -53,7 +53,7 @@ public class LiteflowPropertyAutoConfiguration { liteflowConfig.setGlobalThreadPoolQueueSize(property.getGlobalThreadPoolQueueSize()); liteflowConfig.setGlobalThreadPoolSize(property.getGlobalThreadPoolSize()); liteflowConfig.setEnableNodeInstanceId(property.isEnableNodeInstanceId()); - liteflowConfig.setEnableRuleCache(property.getRuleCache().getEnabled()); + liteflowConfig.setRuleCacheEnabled(property.getRuleCache().isEnabled()); liteflowConfig.setRuleCacheCapacity(property.getRuleCache().getCapacity()); return liteflowConfig; } diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/ruleCache/RuleCacheTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/ruleCache/RuleCacheTest.java index c359683ce..44ec5c0d7 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/ruleCache/RuleCacheTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/ruleCache/RuleCacheTest.java @@ -39,7 +39,7 @@ public class RuleCacheTest extends BaseTest { public static void init() { LiteflowConfig config = new LiteflowConfig(); config.setRuleSource("ruleCache/flow.el.xml"); - config.setEnableRuleCache(true); + config.setRuleCacheEnabled(true); config.setRuleCacheCapacity(5); flowExecutor = FlowExecutorHolder.loadInstance(config); } diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/ruleCache/application.xml b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/ruleCache/application.xml index 278b241f5..16170f76d 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/ruleCache/application.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/ruleCache/application.xml @@ -15,7 +15,7 @@ - +