From b014a3c5da471a0089b95e3ef2f418185f94d675 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Thu, 18 Jul 2019 20:27:30 +0800 Subject: [PATCH] =?UTF-8?q?Bean=20=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xxl/job/admin/controller/JobGroupController.java | 6 ++++-- .../java/com/xxl/job/admin/core/conf/XxlJobScheduler.java | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java index a819256c..a5a3bbff 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java @@ -1,11 +1,11 @@ package com.xxl.job.admin.controller; -import com.xxl.job.admin.core.conf.XxlJobAdminConfig; import com.xxl.job.admin.core.model.XxlJobGroup; import com.xxl.job.admin.core.model.XxlJobRegistry; import com.xxl.job.admin.core.util.I18nUtil; import com.xxl.job.admin.dao.XxlJobGroupDao; import com.xxl.job.admin.dao.XxlJobInfoDao; +import com.xxl.job.admin.dao.XxlJobRegistryDao; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.enums.RegistryConfig; import org.springframework.stereotype.Controller; @@ -31,6 +31,8 @@ public class JobGroupController { public XxlJobInfoDao xxlJobInfoDao; @Resource public XxlJobGroupDao xxlJobGroupDao; + @Resource + private XxlJobRegistryDao xxlJobRegistryDao; @RequestMapping public String index(Model model) { @@ -117,7 +119,7 @@ public class JobGroupController { private List findRegistryByAppName(String appNameParam){ HashMap> appAddressMap = new HashMap>(); - List list = XxlJobAdminConfig.getAdminConfig().getXxlJobRegistryDao().findAll(RegistryConfig.DEAD_TIMEOUT); + List list = xxlJobRegistryDao.findAll(RegistryConfig.DEAD_TIMEOUT); if (list != null) { for (XxlJobRegistry item: list) { if (RegistryConfig.RegistType.EXECUTOR.name().equals(item.getRegistryGroup())) { diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobScheduler.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobScheduler.java index be0931e4..8b51d51b 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobScheduler.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobScheduler.java @@ -20,6 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.annotation.DependsOn; import org.springframework.stereotype.Component; import javax.servlet.ServletException; @@ -33,6 +34,7 @@ import java.util.concurrent.ConcurrentMap; * @author xuxueli 2018-10-28 00:18:17 */ @Component +@DependsOn("xxlJobAdminConfig") public class XxlJobScheduler implements InitializingBean, DisposableBean { private static final Logger logger = LoggerFactory.getLogger(XxlJobScheduler.class);