From ba2349038a93d613c3e41ad1119b0c99e040a627 Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Tue, 5 Jul 2022 22:23:16 +0800 Subject: [PATCH] =?UTF-8?q?enhancement=20#I5FNR4=20=E5=87=8F=E5=B0=91Litef?= =?UTF-8?q?low=E6=A0=B8=E5=BF=83=E5=8C=85=E5=AF=B9=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=8C=85=E7=9A=84=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yomahub/liteflow/builder/LiteFlowChainBuilder.java | 4 ++-- .../yomahub/liteflow/builder/LiteFlowNodeBuilder.java | 4 ++-- .../liteflow/builder/el/LiteFlowChainELBuilder.java | 8 +------- .../liteflow/builder/entity/ExecutableEntity.java | 4 ++-- .../java/com/yomahub/liteflow/core/FlowExecutor.java | 3 +-- .../liteflow/flow/executor/NodeExecutorHelper.java | 4 ++-- .../com/yomahub/liteflow/thread/ExecutorHelper.java | 3 +-- .../liteflow-testcase-el-declare-springboot/pom.xml | 8 ++++++++ .../pom.xml | 8 ++++++++ .../pom.xml | 8 ++++++++ .../liteflow-testcase-el-springboot/pom.xml | 8 ++++++++ .../liteflow-testcase-declare-springboot/pom.xml | 8 ++++++++ .../liteflow-testcase-nospring/pom.xml | 8 ++++++++ .../liteflow-testcase-script-groovy-springboot/pom.xml | 8 ++++++++ .../pom.xml | 8 ++++++++ .../liteflow-testcase-springboot/pom.xml | 8 ++++++++ .../liteflow-testcase-springnative/pom.xml | 8 ++++++++ pom.xml | 10 +++++++++- 18 files changed, 100 insertions(+), 20 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowChainBuilder.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowChainBuilder.java index 6d3e629c7..f0dbc4d5b 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowChainBuilder.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowChainBuilder.java @@ -2,8 +2,8 @@ package com.yomahub.liteflow.builder; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.collection.ListUtil; import cn.hutool.core.util.StrUtil; -import com.google.common.collect.Lists; import com.yomahub.liteflow.enums.ConditionTypeEnum; import com.yomahub.liteflow.flow.FlowBus; import com.yomahub.liteflow.flow.element.Chain; @@ -79,7 +79,7 @@ public class LiteFlowChainBuilder { * build 前简单校验 */ private void checkBuild() { - List errorList = Lists.newArrayList(); + List errorList = new ArrayList<>(); if (StrUtil.isBlank(this.chain.getChainName())) { errorList.add("name is blank"); } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowNodeBuilder.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowNodeBuilder.java index 45496cab4..d2ad3533b 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowNodeBuilder.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowNodeBuilder.java @@ -3,7 +3,6 @@ package com.yomahub.liteflow.builder; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.io.resource.ResourceUtil; import cn.hutool.core.util.StrUtil; -import com.google.common.collect.Lists; import com.yomahub.liteflow.enums.NodeTypeEnum; import com.yomahub.liteflow.exception.NodeBuildException; import com.yomahub.liteflow.flow.FlowBus; @@ -11,6 +10,7 @@ import com.yomahub.liteflow.flow.element.Node; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -120,7 +120,7 @@ public class LiteFlowNodeBuilder { * build 前简单校验 */ private void checkBuild() { - List errorList = Lists.newArrayList(); + List errorList = new ArrayList<>(); if (StrUtil.isBlank(this.node.getId())) { errorList.add("id is blank"); } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java index 32ed181dd..c7275e48c 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java @@ -1,13 +1,10 @@ package com.yomahub.liteflow.builder.el; import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; -import com.google.common.collect.Lists; import com.ql.util.express.DefaultContext; import com.ql.util.express.ExpressRunner; import com.yomahub.liteflow.builder.el.operator.*; -import com.yomahub.liteflow.enums.ConditionTypeEnum; import com.yomahub.liteflow.exception.ELParseException; import com.yomahub.liteflow.exception.FlowSystemException; import com.yomahub.liteflow.flow.FlowBus; @@ -16,11 +13,8 @@ import com.yomahub.liteflow.flow.element.Executable; import com.yomahub.liteflow.flow.element.condition.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import java.util.ArrayList; import java.util.List; -import java.util.function.BiConsumer; -import java.util.function.Consumer; /** * Chain基于代码形式的组装器 @@ -145,7 +139,7 @@ public class LiteFlowChainELBuilder { * build 前简单校验 */ private void checkBuild() { - List errorList = Lists.newArrayList(); + List errorList = new ArrayList<>(); if (StrUtil.isBlank(this.chain.getChainName())) { errorList.add("name is blank"); } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/entity/ExecutableEntity.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/entity/ExecutableEntity.java index f7b6c0032..46e59759d 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/entity/ExecutableEntity.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/entity/ExecutableEntity.java @@ -1,8 +1,8 @@ package com.yomahub.liteflow.builder.entity; import cn.hutool.core.collection.CollUtil; -import com.google.common.collect.Lists; +import java.util.ArrayList; import java.util.List; /** @@ -57,7 +57,7 @@ public class ExecutableEntity { public ExecutableEntity addNodeCondComponent(ExecutableEntity conditionNodeEntity) { if (CollUtil.isEmpty(this.nodeCondComponents)) { - this.nodeCondComponents = Lists.newArrayList(); + this.nodeCondComponents = new ArrayList<>(); } this.nodeCondComponents.add(conditionNodeEntity); return this; 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 6852a803d..68590be25 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 @@ -13,7 +13,6 @@ import cn.hutool.core.util.BooleanUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ReUtil; import cn.hutool.core.util.StrUtil; -import com.google.common.collect.Lists; import com.yomahub.liteflow.enums.FlowParserTypeEnum; import com.yomahub.liteflow.exception.*; import com.yomahub.liteflow.flow.FlowBus; @@ -120,7 +119,7 @@ public class FlowExecutor { return; } - List sourceRulePathList = Lists.newArrayList(liteflowConfig.getRuleSource().split(",|;")); + List sourceRulePathList = ListUtil.toList(liteflowConfig.getRuleSource().split(",|;")); FlowParser parser = null; Set parserNameSet = new HashSet<>(); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/executor/NodeExecutorHelper.java b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/executor/NodeExecutorHelper.java index dbf6fe673..6bc122a78 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/executor/NodeExecutorHelper.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/executor/NodeExecutorHelper.java @@ -1,7 +1,7 @@ package com.yomahub.liteflow.flow.executor; +import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ObjectUtil; -import com.google.common.collect.Maps; import com.yomahub.liteflow.spi.holder.ContextAwareHolder; import java.util.Map; @@ -17,7 +17,7 @@ public class NodeExecutorHelper { private final Map, NodeExecutor> nodeExecutorMap; private NodeExecutorHelper() { - nodeExecutorMap = Maps.newConcurrentMap(); + nodeExecutorMap = MapUtil.newConcurrentHashMap(); } //使用静态内部类实现单例模式 diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorHelper.java b/liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorHelper.java index f62314197..a07c2f01a 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorHelper.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorHelper.java @@ -11,7 +11,6 @@ package com.yomahub.liteflow.thread; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import com.google.common.collect.Maps; import com.yomahub.liteflow.exception.ThreadExecutorServiceCreateException; import com.yomahub.liteflow.property.LiteflowConfig; import com.yomahub.liteflow.property.LiteflowConfigGetter; @@ -40,7 +39,7 @@ public class ExecutorHelper { private final Map executorServiceMap; private ExecutorHelper() { - executorServiceMap = Maps.newConcurrentMap(); + executorServiceMap = MapUtil.newConcurrentHashMap(); } /** diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/pom.xml b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/pom.xml index 50fb386b5..6d5cff214 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/pom.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/pom.xml @@ -39,6 +39,14 @@ zkclient test + + org.apache.curator + curator-framework + + + org.apache.curator + curator-recipes + diff --git a/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/pom.xml b/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/pom.xml index fda750c1e..f96ef7f26 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/pom.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/pom.xml @@ -38,6 +38,14 @@ zkclient test + + org.apache.curator + curator-framework + + + org.apache.curator + curator-recipes + com.yomahub liteflow-script-groovy diff --git a/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/pom.xml b/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/pom.xml index d976ffb3a..386b77a01 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/pom.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/pom.xml @@ -36,6 +36,14 @@ com.101tec zkclient + + org.apache.curator + curator-framework + + + org.apache.curator + curator-recipes + com.yomahub liteflow-script-qlexpress diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/pom.xml b/liteflow-testcase-el/liteflow-testcase-el-springboot/pom.xml index 8bec4c786..d851a8b0b 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/pom.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/pom.xml @@ -38,6 +38,14 @@ zkclient test + + org.apache.curator + curator-framework + + + org.apache.curator + curator-recipes + diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml index d50f6d8b5..3f8473004 100644 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml +++ b/liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml @@ -39,6 +39,14 @@ zkclient test + + org.apache.curator + curator-framework + + + org.apache.curator + curator-recipes + diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/pom.xml b/liteflow-testcase-old/liteflow-testcase-nospring/pom.xml index 2d18b6532..5e8619777 100644 --- a/liteflow-testcase-old/liteflow-testcase-nospring/pom.xml +++ b/liteflow-testcase-old/liteflow-testcase-nospring/pom.xml @@ -38,6 +38,14 @@ zkclient test + + org.apache.curator + curator-framework + + + org.apache.curator + curator-recipes + diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/pom.xml b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/pom.xml index 1adce85e1..c52ee410c 100644 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/pom.xml +++ b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/pom.xml @@ -38,6 +38,14 @@ zkclient test + + org.apache.curator + curator-framework + + + org.apache.curator + curator-recipes + com.yomahub liteflow-script-groovy diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/pom.xml b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/pom.xml index 8cd9b7e00..6bfd4a3a8 100644 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/pom.xml +++ b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/pom.xml @@ -36,6 +36,14 @@ com.101tec zkclient + + org.apache.curator + curator-framework + + + org.apache.curator + curator-recipes + com.yomahub liteflow-script-qlexpress diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/pom.xml b/liteflow-testcase-old/liteflow-testcase-springboot/pom.xml index 7f2e37c74..8b7f1897e 100644 --- a/liteflow-testcase-old/liteflow-testcase-springboot/pom.xml +++ b/liteflow-testcase-old/liteflow-testcase-springboot/pom.xml @@ -35,6 +35,14 @@ com.101tec zkclient + + org.apache.curator + curator-framework + + + org.apache.curator + curator-recipes + diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/pom.xml b/liteflow-testcase-old/liteflow-testcase-springnative/pom.xml index 5c9b5cc2a..0d6f9ff44 100644 --- a/liteflow-testcase-old/liteflow-testcase-springnative/pom.xml +++ b/liteflow-testcase-old/liteflow-testcase-springnative/pom.xml @@ -49,6 +49,14 @@ com.101tec zkclient + + org.apache.curator + curator-framework + + + org.apache.curator + curator-recipes + org.aspectj aspectjweaver diff --git a/pom.xml b/pom.xml index 1e684a548..f0d09fa0a 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ org.springframework spring-test ${spring.version} - provided + test true @@ -124,6 +124,7 @@ junit junit ${junit.version} + test org.apache.curator @@ -139,12 +140,14 @@ org.slf4j + provided true org.apache.curator curator-recipes ${curator.version} + provided true @@ -161,11 +164,14 @@ org.apache.curator curator-test ${curator-test.version} + test com.101tec zkclient ${zkclient.version} + provided + true @@ -193,6 +199,8 @@ org.aspectj aspectjweaver ${aspectjweaver.version} + provided + true ch.qos.logback