From 02867d5b126b7dcfce281679a8a7a7a5695f1792 Mon Sep 17 00:00:00 2001
From: aoshiguchen <1052045476@qq.com>
Date: Wed, 31 Aug 2022 23:02:45 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EStdSchedulerFactory=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
neutrino-core/pom.xml | 5 +
.../core/scheduler/test1/Launcher.java | 50 +++
.../scheduler/test1/RemoteHttpJobBean.java | 46 +++
neutrino-proxy-admin/src/lang/zh.js | 4 +-
neutrino-proxy-admin/src/router/index.js | 4 +-
.../src/views/proxy/license.vue | 332 ++++++++++++++++++
.../src/views/proxy/portMapping.vue | 332 ++++++++++++++++++
7 files changed, 770 insertions(+), 3 deletions(-)
create mode 100644 neutrino-core/src/test/java/fun/asgc/neutrino/core/scheduler/test1/Launcher.java
create mode 100755 neutrino-core/src/test/java/fun/asgc/neutrino/core/scheduler/test1/RemoteHttpJobBean.java
diff --git a/neutrino-core/pom.xml b/neutrino-core/pom.xml
index f516f75d..c144c00a 100644
--- a/neutrino-core/pom.xml
+++ b/neutrino-core/pom.xml
@@ -53,5 +53,10 @@
+ * All right reserved. + *
+ * This software is the confidential and proprietary
+ * information of Zeyi Company of China.
+ * ("Confidential Information"). You shall not disclose
+ * such Confidential Information and shall use it only
+ * in accordance with the terms of the contract agreement
+ * you entered into with Zeyi inc.
+ */
+package fun.asgc.neutrino.core.scheduler.test1;
+
+import fun.asgc.neutrino.core.annotation.Init;
+import fun.asgc.neutrino.core.annotation.NeutrinoApplication;
+import fun.asgc.neutrino.core.context.NeutrinoLauncher;
+import org.quartz.*;
+import org.quartz.impl.StdSchedulerFactory;
+
+/**
+ *
+ * @author: wen.y
+ * @date: 2022/8/31
+ */
+@NeutrinoApplication
+public class Launcher {
+
+ @Init
+ public void init() throws SchedulerException {
+ TriggerKey triggerKey = TriggerKey.triggerKey("1");
+ JobKey jobKey = new JobKey("1");
+
+ SchedulerFactory schedulerFactory = new StdSchedulerFactory();
+ Scheduler scheduler = schedulerFactory.getScheduler();
+
+ CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("0/1 * * * * ?").withMisfireHandlingInstructionDoNothing();
+ CronTrigger cronTrigger = TriggerBuilder.newTrigger().withIdentity(triggerKey).withSchedule(cronScheduleBuilder).build();
+
+ Class extends Job> jobClass_ = RemoteHttpJobBean.class; // Class.forName(jobInfo.getJobClass());
+ JobDetail jobDetail = JobBuilder.newJob(jobClass_).withIdentity(jobKey).build();
+
+ scheduler.scheduleJob(jobDetail, cronTrigger);
+ scheduler.start();
+ }
+
+ public static void main(String[] args) {
+ NeutrinoLauncher.runSync(Launcher.class, args);
+ }
+}
diff --git a/neutrino-core/src/test/java/fun/asgc/neutrino/core/scheduler/test1/RemoteHttpJobBean.java b/neutrino-core/src/test/java/fun/asgc/neutrino/core/scheduler/test1/RemoteHttpJobBean.java
new file mode 100755
index 00000000..0b0221f7
--- /dev/null
+++ b/neutrino-core/src/test/java/fun/asgc/neutrino/core/scheduler/test1/RemoteHttpJobBean.java
@@ -0,0 +1,46 @@
+package fun.asgc.neutrino.core.scheduler.test1;
+
+import fun.asgc.neutrino.core.bean.BeanWrapper;
+import fun.asgc.neutrino.core.util.DateUtil;
+import org.quartz.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Date;
+
+/**
+ * http job bean
+ * “@DisallowConcurrentExecution” diable concurrent, thread size can not be only one, better given more
+ * @author xuxueli 2015-12-17 18:20:34
+ */
+public class RemoteHttpJobBean implements Job {
+ private static Logger logger = LoggerFactory.getLogger(RemoteHttpJobBean.class);
+
+ @Override
+ public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+// try {
+// BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
+// MutablePropertyValues pvs = new MutablePropertyValues();
+// pvs.addPropertyValues(context.getScheduler().getContext());
+// pvs.addPropertyValues(context.getMergedJobDataMap());
+// bw.setPropertyValues(pvs, true);
+// } catch (SchedulerException var4) {
+// throw new JobExecutionException(var4);
+// }
+//
+// this.executeInternal(context);
+ System.out.println("job执行:" + DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
+ }
+
+ protected void executeInternal(JobExecutionContext context)
+ throws JobExecutionException {
+
+// // load jobId
+// JobKey jobKey = context.getTrigger().getJobKey();
+// Integer jobId = Integer.valueOf(jobKey.getName());
+//
+// // trigger
+// JobTriggerPoolHelper.trigger(jobId, TriggerTypeEnum.CRON, -1, null, null);
+ }
+
+}
diff --git a/neutrino-proxy-admin/src/lang/zh.js b/neutrino-proxy-admin/src/lang/zh.js
index 9b2f68a8..89984b47 100644
--- a/neutrino-proxy-admin/src/lang/zh.js
+++ b/neutrino-proxy-admin/src/lang/zh.js
@@ -47,7 +47,9 @@ export default {
user: '用户管理',
system: '系统管理',
portPool: '端口池管理',
- proxy: '代理配置'
+ proxy: '代理配置',
+ license: 'License管理',
+ portMapping: '端口映射'
},
navbar: {
logOut: '退出登录',
diff --git a/neutrino-proxy-admin/src/router/index.js b/neutrino-proxy-admin/src/router/index.js
index d858335c..eef690b9 100644
--- a/neutrino-proxy-admin/src/router/index.js
+++ b/neutrino-proxy-admin/src/router/index.js
@@ -248,8 +248,8 @@ export const asyncRouterMap = [
icon: 'component'
},
children: [
- { path: 'user', component: _import('system/user'), name: 'user', meta: { title: 'user' }},
- { path: 'portPool', component: _import('system/portPool'), name: 'portPool', meta: { title: 'portPool' }}
+ { path: 'license', component: _import('proxy/license'), name: 'license', meta: { title: 'license' }},
+ { path: 'portMapping', component: _import('proxy/portMapping'), name: 'portMapping', meta: { title: 'portMapping' }}
]
},
{
diff --git a/neutrino-proxy-admin/src/views/proxy/license.vue b/neutrino-proxy-admin/src/views/proxy/license.vue
index e69de29b..74529330 100644
--- a/neutrino-proxy-admin/src/views/proxy/license.vue
+++ b/neutrino-proxy-admin/src/views/proxy/license.vue
@@ -0,0 +1,332 @@
+
+