From 031ab702d1a6c08c5339b9f5f4514c6879941a97 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期三, 07 五月 2025 10:47:24 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreConstantManage.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreConstantManage.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreConstantManage.java new file mode 100644 index 0000000..492aab1 --- /dev/null +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreConstantManage.java @@ -0,0 +1,45 @@ +package com.dy.common.mw.core; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.logging.log4j.*; + +public class CoreConstantManage { + + private final static Logger log = LogManager.getLogger(CoreConstantManage.class.getName()) ; + + private final static CoreConstantManage instance = new CoreConstantManage() ; + + private List<CoreConstantTimer> coreConstantTimers ; + + private Long coreInterval = 100L ;//鏍稿績绾跨▼鏆傚仠闂撮殧 + + private CoreConstantManage(){ + coreConstantTimers = new ArrayList<>() ; + } + + public static CoreConstantManage getInstance(){ + return instance ; + } + + /** + * 璁剧疆鏆傚仠鏃堕暱 + * @param coreInterval 鏍稿績绾跨▼鏆傚仠闂撮殧 + */ + public void setSleep(Long coreInterval){ + this.coreInterval = coreInterval ; + } + + public void start(){ + //鎭掍箙浠诲姟 + List<CoreTask> constantTasks = CoreUnit.getAllConstantTasks(); + if (constantTasks != null && constantTasks.size() > 0) { + for (CoreTask task : constantTasks) { + //new CoreConstantThread(sleepBigBusy, sleepSmallBusy, task).start(); + coreConstantTimers.add(new CoreConstantTimer(coreInterval, task).start()); + } + } + } + +} -- Gitblit v1.8.0