Răsfoiți Sursa

优化javadoc方面的规范

everywhere.z 6 luni în urmă
părinte
comite
c7ced98ebf

+ 2 - 0
liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/base/OperatorHelper.java

@@ -159,6 +159,8 @@ public class OperatorHelper {
 	/**
 	 * 所谓Boolean item,指的是那些最终的结果值为布尔类型的Item
 	 * 布尔类型的items有,if,while,break类型的Node,以及AndOrCondition以及NotCondition
+	 * @param object 检查的对象
+	 * @throws Exception 检查过程中抛的错
 	 */
 	public static void checkObjMustBeBooleanTypeItem(Object object) throws Exception{
 		if (!(object instanceof Executable)){

+ 9 - 6
liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java

@@ -132,7 +132,9 @@ public class FlowBus {
 
 	/**
 	 * 添加已托管的节点(如:Spring、Solon 管理的节点)
-	 * */
+	 * @param nodeId nodeId
+	 * @param nodeComponent nodeComponent
+	 */
 	public static void addManagedNode(String nodeId, NodeComponent nodeComponent) {
 		// 根据class来猜测类型
 		NodeTypeEnum type = NodeTypeEnum.guessType(nodeComponent.getClass());
@@ -182,6 +184,7 @@ public class FlowBus {
 	 * @param name 节点名称
 	 * @param nodeType 节点类型
 	 * @param script 脚本
+	 * @param language 语言
 	 */
 	public static void addScriptNode(String nodeId, String name, NodeTypeEnum nodeType, String script,
 			String language) {
@@ -199,11 +202,11 @@ public class FlowBus {
 
 	/**
 	 * 添加脚本 node,并且编译脚本
-	 * @param nodeId
-	 * @param name
-	 * @param type
-	 * @param script
-	 * @param language
+	 * @param nodeId nodeId
+	 * @param name name
+	 * @param type type
+	 * @param script script content
+	 * @param language language
 	 * @return NodeComponent instance
 	 */
 	public static NodeComponent addScriptNodeAndCompile(String nodeId, String name, NodeTypeEnum type, String script,

+ 2 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Chain.java

@@ -70,6 +70,7 @@ public class Chain implements Executable{
 
 	/**
 	 * @deprecated 请使用{@link #getChainId()}
+	 * @return chainId
 	 */
 	@Deprecated
 	public String getChainName() {
@@ -77,7 +78,7 @@ public class Chain implements Executable{
 	}
 
 	/**
-	 * @param chainName
+	 * @param chainName chainId
 	 * @deprecated 请使用 {@link #setChainId(String)}
 	 */
 	public void setChainName(String chainName) {

+ 1 - 0
liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Condition.java

@@ -173,6 +173,7 @@ public abstract class Condition implements Executable{
 
 	/**
 	 * 请使用 {@link #setCurrChainId(String)}
+	 * @return currChainId
 	 */
 	@Deprecated
 	public String getCurrChainName() {

+ 2 - 2
liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/Executable.java

@@ -18,7 +18,7 @@ public interface Executable{
 	ExecuteableTypeEnum getExecuteType();
 
 	/**
-	 * @return
+	 * @return executeName or id
 	 * @deprecated 请使用 {@link #getId()}
 	 */
 	@Deprecated
@@ -27,7 +27,7 @@ public interface Executable{
 	}
 
 	/**
-	 * @param currentChainName
+	 * @param currentChainName currentChainName
 	 * @deprecated 请使用 {@link #setCurrChainId(String)}
 	 */
 	default void setCurrChainName(String currentChainName) {

+ 5 - 0
liteflow-core/src/main/java/com/yomahub/liteflow/flow/executor/NodeExecutor.java

@@ -21,6 +21,8 @@ public abstract class NodeExecutor {
 
 	/**
 	 * 执行器执行入口-若需要更大维度的执行方式可以重写该方法
+	 * @param instance instance
+	 * @throws Exception 执行过程中抛的错
 	 */
 	public void execute(NodeComponent instance) throws Exception {
 		int retryCount = instance.getRetryCount();
@@ -54,6 +56,9 @@ public abstract class NodeExecutor {
 
 	/**
 	 * 执行重试逻辑 - 子类通过实现该方法进行重试逻辑的控制
+	 * @param instance instance
+	 * @param currentRetryCount currentRetryCount
+	 * @throws Exception 抛出重试执行过程中的错
 	 */
 	protected void retry(NodeComponent instance, int currentRetryCount) throws Exception {
 		Slot slot = DataBus.getSlot(instance.getSlotIndex());

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/flow/executor/NodeExecutorHelper.java

@@ -34,7 +34,7 @@ public class NodeExecutorHelper {
 
 	/**
 	 * 获取帮助者的实例
-	 * @return
+	 * @return NodeExecutorHelper
 	 */
 	public static NodeExecutorHelper loadInstance() {
 		// 外围类能直接访问内部类(不管是否是静态的)的私有变量

+ 1 - 0
liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/CompletableFutureExpand.java

@@ -10,6 +10,7 @@ public class CompletableFutureExpand {
      *
      * @param timeout 在出现 TimeoutException 异常完成之前等待多长时间,以 {@code unit} 为单位
      * @param unit    一个 {@link TimeUnit},结合 {@code timeout} 参数,表示给定粒度单位的持续时间
+     * @param timeoutDefaultObj timeoutDefaultObj
      * @return 入参的 CompletableFuture
      */
     public static <T> CompletableFuture<T> completeOnTimeout(CompletableFuture<T> future, long timeout, TimeUnit unit, T timeoutDefaultObj) {

+ 13 - 13
liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/strategy/ParallelStrategyExecutor.java

@@ -42,12 +42,12 @@ public abstract class ParallelStrategyExecutor {
 
     /**
      * 封装 CompletableFuture 对象
-     * @param executable
-     * @param parallelExecutor
-     * @param whenCondition
-     * @param currChainId
-     * @param slotIndex
-     * @return
+     * @param executable executable
+     * @param parallelExecutor parallelExecutor
+     * @param whenCondition whenCondition
+     * @param currChainId currChainId
+     * @param slotIndex slotIndex
+     * @return CompletableFuture
      */
     protected CompletableFuture<WhenFutureObj> wrappedFutureObj(Executable executable, ExecutorService parallelExecutor,
                                                                 WhenCondition whenCondition, String currChainId, Integer slotIndex) {
@@ -62,7 +62,7 @@ public abstract class ParallelStrategyExecutor {
 
     /**
      * 设置 WhenCondition 参数
-     * @param whenCondition
+     * @param whenCondition whenCondition
      */
     protected void setWhenConditionParams(WhenCondition whenCondition) {
         // 获得 liteflow 的参数
@@ -87,9 +87,9 @@ public abstract class ParallelStrategyExecutor {
     /**
      * 过滤 WHEN 待执行任务
      * @param executableList 所有任务列表
-     * @param slotIndex
+     * @param slotIndex slotIndex
      * @param currentChainId 当前执行的 chainId
-     * @return
+     * @return Executable的Stream对象
      */
     protected Stream<Executable> filterWhenTaskList(List<Executable> executableList, Integer slotIndex, String currentChainId) {
         // 1.先进行过滤,前置和后置组件过滤掉,因为在 EL Chain 处理的时候已经提出来了
@@ -120,9 +120,9 @@ public abstract class ParallelStrategyExecutor {
 
     /**
      * 获取所有任务 CompletableFuture 集合
-     * @param whenCondition
-     * @param slotIndex
-     * @return
+     * @param whenCondition whenCondition
+     * @param slotIndex slotIndex
+     * @return List
      */
     protected List<CompletableFuture<WhenFutureObj>> getWhenAllTaskList(WhenCondition whenCondition, Integer slotIndex) {
 
@@ -152,7 +152,7 @@ public abstract class ParallelStrategyExecutor {
      * @param slotIndex 当前 slot 的 index
      * @param whenAllFutureList 并行组件中所有任务列表
      * @param specifyTask 指定预先完成的任务,详见 {@link ParallelStrategyEnum}
-     * @throws Exception
+     * @throws Exception 处理过程中抛的异常
      */
     protected void handleTaskResult(WhenCondition whenCondition, Integer slotIndex, List<CompletableFuture<WhenFutureObj>> whenAllFutureList,
                                     CompletableFuture<?> specifyTask) throws Exception {

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/strategy/ParallelStrategyHelper.java

@@ -64,7 +64,7 @@ public class ParallelStrategyHelper {
 
     /**
      * 默认需完成所有任务
-     * @return
+     * @return ParallelStrategyExecutor
      */
     public ParallelStrategyExecutor buildParallelExecutor() {
         return buildParallelExecutor(ParallelStrategyEnum.ALL);

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/monitor/MonitorFile.java

@@ -53,7 +53,7 @@ public class MonitorFile {
 
 	/**
 	 * 创建文件监听
-	 */
+     */
 	public void create() throws Exception {
 		for (String path : PATH_SET) {
 			long interval = TimeUnit.MILLISECONDS.toMillis(2);

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorCondition/ExecutorCondition.java

@@ -6,7 +6,7 @@ package com.yomahub.liteflow.thread.ExecutorCondition;
  * <p>Description: 执行器条件对象</p>
  *
  * @author jason
- * @Date 2024/11/12
+ * @since 2.13.0
  */
 public class ExecutorCondition {
     private final boolean conditionLevel;

+ 6 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorCondition/ExecutorConditionBuilder.java

@@ -15,13 +15,18 @@ import com.yomahub.liteflow.property.LiteflowConfig;
  * <p>Description: 执行器构建对象</p>
  *
  * @author jason
- * @Date 2024/11/12
+ * @since 2.13.0
  */
 
 public class ExecutorConditionBuilder {
 
     /**
      * 构建执行器条件
+     * @param condition condition
+     * @param chain chain
+     * @param liteflowConfig liteflowConfig
+     * @param type type
+     * @return ExecutorCondition
      */
     public static ExecutorCondition buildExecutorCondition(
             Condition condition,

+ 6 - 0
liteflow-testcase-el/liteflow-testcase-el-sql-springboot-sharding-jdbc/pom.xml

@@ -80,6 +80,12 @@
             <groupId>org.apache.shardingsphere</groupId>
             <artifactId>shardingsphere-jdbc</artifactId>
             <version>${shardingsphere.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.shardingsphere</groupId>
+                    <artifactId>shardingsphere-test-util</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
 </project>