mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 20:22:07 +08:00
!35 支持在NodeComponent里自定义beforeProcess和afterProcess,没有覆盖方式时,默认读取aspect里的方法
Merge pull request !35 from Aaron/master
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user