From 1aeaded9a2f9f42ae149ac9d134e12f88123928c Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Wed, 7 Mar 2018 20:50:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=B1=9E=E6=80=A7=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=20"=E4=BB=BB=E5=8A=A1=E6=A8=A1=E5=BC=8F=E3=80=81?= =?UTF-8?q?=E9=98=BB=E5=A1=9E=E7=AD=96=E7=95=A5"=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 2 +- .../admin/core/schedule/XxlJobDynamicScheduler.java | 11 +++++++++++ .../src/main/resources/i18n/message.properties | 3 +++ .../src/main/resources/i18n/message_en.properties | 3 +++ .../job/core/enums/ExecutorBlockStrategyEnum.java | 12 ++++++++---- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 8b618221..3c0f3add 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1157,7 +1157,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 1、[迭代中]支持通过API服务操作任务信息; - 2、[迭代中]任务告警逻辑调整:任务调度,以及任务回调失败时,均推送监控队列。后期考虑通过任务Log字段控制告警状态; - 3、[迭代中]任务超时设置,超时任务主动终止; -- 4、[迭代中]依赖JAR中枚举国际化问题处理; +- 4、任务属性枚举 "任务模式、阻塞策略" 国际化优化; ### TODO LIST diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java index ea53d160..a6b6c2ef 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java @@ -4,12 +4,14 @@ import com.xxl.job.admin.core.jobbean.RemoteHttpJobBean; import com.xxl.job.admin.core.model.XxlJobInfo; import com.xxl.job.admin.core.thread.JobFailMonitorHelper; import com.xxl.job.admin.core.thread.JobRegistryMonitorHelper; +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.XxlJobLogDao; import com.xxl.job.admin.dao.XxlJobRegistryDao; import com.xxl.job.core.biz.AdminBiz; import com.xxl.job.core.biz.ExecutorBiz; +import com.xxl.job.core.enums.ExecutorBlockStrategyEnum; import com.xxl.job.core.rpc.netcom.NetComClientProxy; import com.xxl.job.core.rpc.netcom.NetComServerFactory; import org.quartz.*; @@ -76,11 +78,20 @@ public final class XxlJobDynamicScheduler implements ApplicationContextAware { NetComServerFactory.putService(AdminBiz.class, XxlJobDynamicScheduler.adminBiz); NetComServerFactory.setAccessToken(accessToken); + // init i18n + initI18n(); + // valid Assert.notNull(scheduler, "quartz scheduler is null"); logger.info(">>>>>>>>> init xxl-job admin success."); } + private void initI18n(){ + for (ExecutorBlockStrategyEnum item:ExecutorBlockStrategyEnum.values()) { + item.setTitle(I18nUtil.getString("jobconf_block_".concat(item.name()))); + } + } + public void destroy(){ // admin registry stop JobRegistryMonitorHelper.getInstance().toStop(); diff --git a/xxl-job-admin/src/main/resources/i18n/message.properties b/xxl-job-admin/src/main/resources/i18n/message.properties index 66c7aa9d..e044ad9d 100644 --- a/xxl-job-admin/src/main/resources/i18n/message.properties +++ b/xxl-job-admin/src/main/resources/i18n/message.properties @@ -191,6 +191,9 @@ jobgroup_del_limit_0=拒绝删除,该执行器使用中 jobgroup_del_limit_1=拒绝删除, 系统至少保留一个执行器 ## job conf +jobconf_block_SERIAL_EXECUTION=单机串行 +jobconf_block_DISCARD_LATER=丢弃后续调度 +jobconf_block_COVER_EARLY=覆盖之前调度 jobconf_fail_alarm=失败告警 jobconf_fail_retry=失败重试 jobconf_route_first=第一个 diff --git a/xxl-job-admin/src/main/resources/i18n/message_en.properties b/xxl-job-admin/src/main/resources/i18n/message_en.properties index 9a8d14bd..52c92f56 100644 --- a/xxl-job-admin/src/main/resources/i18n/message_en.properties +++ b/xxl-job-admin/src/main/resources/i18n/message_en.properties @@ -191,6 +191,9 @@ jobgroup_del_limit_0=Refuse to delete, the executor is being used jobgroup_del_limit_1=Refuses to delete, the system retains at least one executor ## job conf +jobconf_block_SERIAL_EXECUTION=Serial execution +jobconf_block_DISCARD_LATER=Discard Later +jobconf_block_COVER_EARLY=Cover Early jobconf_fail_alarm=Fail Alarm jobconf_fail_retry=Fail Retry jobconf_route_first=First diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/enums/ExecutorBlockStrategyEnum.java b/xxl-job-core/src/main/java/com/xxl/job/core/enums/ExecutorBlockStrategyEnum.java index 0b340365..a9dc1bea 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/enums/ExecutorBlockStrategyEnum.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/enums/ExecutorBlockStrategyEnum.java @@ -5,15 +5,19 @@ package com.xxl.job.core.enums; */ public enum ExecutorBlockStrategyEnum { - SERIAL_EXECUTION("单机串行"), + SERIAL_EXECUTION("Serial execution"), /*CONCURRENT_EXECUTION("并行"),*/ - DISCARD_LATER("丢弃后续调度"), - COVER_EARLY("覆盖之前调度"); + DISCARD_LATER("Discard Later"), + COVER_EARLY("Cover Early"); - private final String title; + private String title; private ExecutorBlockStrategyEnum (String title) { this.title = title; } + + public void setTitle(String title) { + this.title = title; + } public String getTitle() { return title; }