From 1b8e19d0635b8e9064e058890ecb0ef9ef95b1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=A7=80=E4=BF=A1?= Date: Fri, 15 Oct 2021 10:53:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=9C=A8NodeComponent?= =?UTF-8?q?=E9=87=8C=E8=87=AA=E5=AE=9A=E4=B9=89beforeProcess=E5=92=8Cafter?= =?UTF-8?q?Process,=E6=B2=A1=E6=9C=89=E8=A6=86=E7=9B=96=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=BB=98=E8=AE=A4=E8=AF=BB=E5=8F=96aspect?= =?UTF-8?q?=E9=87=8C=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yomahub/liteflow/core/NodeComponent.java | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java b/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java index 3fc76e517..71caefbd8 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java @@ -73,17 +73,9 @@ public abstract class NodeComponent { StopWatch stopWatch = new StopWatch(); stopWatch.start(); - // process前置处理 - if (ObjectUtil.isNotNull(ComponentScanner.cmpAroundAspect)) { - ComponentScanner.cmpAroundAspect.beforeProcess(this.getNodeId(), slot); - } - + self.beforeProcess(this.getNodeId(), slot); self.process(); - - // process后置处理 - if (ObjectUtil.isNotNull(ComponentScanner.cmpAroundAspect)) { - ComponentScanner.cmpAroundAspect.afterProcess(this.getNodeId(), slot); - } + self.afterProcess(this.getNodeId(), slot); stopWatch.stop(); @@ -109,6 +101,25 @@ public abstract class NodeComponent { public abstract void process() throws Exception; + /** + * process前置处理 + */ + public void beforeProcess(String nodeId, Slot slot) { + if (ObjectUtil.isNotNull(ComponentScanner.cmpAroundAspect)) { + ComponentScanner.cmpAroundAspect.beforeProcess(nodeId, slot); + } + } + + /** + * process后置处理 + */ + public void afterProcess(String nodeId, Slot slot) { + if (ObjectUtil.isNotNull(ComponentScanner.cmpAroundAspect)) { + ComponentScanner.cmpAroundAspect.afterProcess(nodeId, slot); + } + } + + /** * 是否进入该节点 * @return boolean