Commit a7f371ca by huangfusuper

JAVA节点支持

parent 373de7c1
...@@ -32,6 +32,7 @@ import java.util.Date; ...@@ -32,6 +32,7 @@ import java.util.Date;
* @date: 2019/11/20 15:08 * @date: 2019/11/20 15:08
**/ **/
@Slf4j @Slf4j
@Deprecated
public class JavaBeanJobTask implements TimerTask { public class JavaBeanJobTask implements TimerTask {
private final String HTTP_PRE = "http://"; private final String HTTP_PRE = "http://";
......
package com.byit.thread.helper; package com.byit.thread.helper;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.byit.dto.plugin.JavaTask;
import com.byit.enums.NodeTypeEnum; import com.byit.enums.NodeTypeEnum;
import com.byit.enums.PlaceholderEnum; import com.byit.enums.PlaceholderEnum;
import com.byit.enums.ScheduleTypeEnum; import com.byit.enums.ScheduleTypeEnum;
...@@ -12,6 +13,7 @@ import com.byit.model.JobTaskSchedule; ...@@ -12,6 +13,7 @@ import com.byit.model.JobTaskSchedule;
import com.byit.service.JobTaskScheduleService; import com.byit.service.JobTaskScheduleService;
import com.byit.service.impl.JobTaskRunLogServiceImpl; import com.byit.service.impl.JobTaskRunLogServiceImpl;
import com.byit.task.JavaBeanJobTask; import com.byit.task.JavaBeanJobTask;
import com.byit.task.JavaTaskJobTask;
import com.byit.task.ScriptExecutorJobTask; import com.byit.task.ScriptExecutorJobTask;
import com.byit.thread.BaseThreadRunHelper; import com.byit.thread.BaseThreadRunHelper;
import com.byit.util.SpringUtil; import com.byit.util.SpringUtil;
...@@ -66,7 +68,12 @@ public class ScheduleThreadRunHelper extends BaseThreadRunHelper { ...@@ -66,7 +68,12 @@ public class ScheduleThreadRunHelper extends BaseThreadRunHelper {
if (NodeTypeEnum.JAVA.getType().equals(mythJobTaskSchedule.getJobType())) { if (NodeTypeEnum.JAVA.getType().equals(mythJobTaskSchedule.getJobType())) {
log.debug("------节点{},开始构建java执行器-------",mythJobTaskSchedule); log.debug("------节点{},开始构建java执行器-------",mythJobTaskSchedule);
//构建调度执行器 //构建调度执行器
timerTask = new JavaBeanJobTask(mythJobTaskSchedule); JavaTask javaTask = new JavaTask();
javaTask.setTriggerTime(mythJobTaskSchedule.getTriggerTime());
javaTask.setJobName(mythJobTaskSchedule.getNodeName());
javaTask.setTaskName(mythJobTaskSchedule.getNodeName());
javaTask.setParam(mythJobTaskSchedule.getRunParam());
timerTask = new JavaTaskJobTask(javaTask);
}else if(NodeTypeEnum.PYTHON.getCode().equals(mythJobTaskSchedule.getJobType())){ }else if(NodeTypeEnum.PYTHON.getCode().equals(mythJobTaskSchedule.getJobType())){
log.debug("------节点{},开始构建脚本执行器-------",mythJobTaskSchedule); log.debug("------节点{},开始构建脚本执行器-------",mythJobTaskSchedule);
//构建脚本调度执行器 //构建脚本调度执行器
......
...@@ -76,6 +76,16 @@ public class JavaTask implements Serializable { ...@@ -76,6 +76,16 @@ public class JavaTask implements Serializable {
private String alarmEmail; private String alarmEmail;
/** /**
* 调度类型
*/
private String scheduleType;
/**
* 任务类型
*/
private String jobType;
/**
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment