parent
c8a55b9074
commit
548426e9a7
|
@ -786,14 +786,14 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
|
|||
#### 6.14 版本 V1.7.0 特性 (Coding)
|
||||
- 1、支持脚本JOB(源码或指定路径), 即shell/python/php等, 日志实时输出并支持在线监控;定制JobHandler实现;
|
||||
|
||||
|
||||
#### TODO LIST
|
||||
- 1、任务并行触发处理规则:串行调度队列(默认)、并行、忽略、覆盖;
|
||||
- 2、任务权限管理;
|
||||
- 3、执行器,server启动,注册逻辑调整;
|
||||
- 4、调度失败重试机制;
|
||||
- 5、JobHandler开启多线程时,支持记录执行日志;
|
||||
- 6、执行器与数据库解耦,只需配置调度中心集群地址即可;
|
||||
|
||||
- 6、执行器与数据库解耦,只需配置调度中心集群地址即可(与当前通过JDBC注册自动发现方式,相冲突,待考虑);
|
||||
|
||||
## 七、其他
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ CREATE TABLE `XXL_JOB_QRTZ_TRIGGER_INFO` (
|
|||
`executor_route_strategy` varchar(50) DEFAULT NULL COMMENT '执行器路由策略',
|
||||
`executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
|
||||
`executor_param` varchar(255) DEFAULT NULL COMMENT '执行器任务参数',
|
||||
`glue_switch` int(11) DEFAULT '0' COMMENT 'GLUE模式开关:0-否,1-是',
|
||||
`glue_type` varchar(50) NOT NULL COMMENT 'GLUE类型',
|
||||
`glue_source` text COMMENT 'GLUE源代码',
|
||||
`glue_remark` varchar(128) DEFAULT NULL COMMENT 'GLUE备注',
|
||||
`glue_updatetime` datetime DEFAULT NULL COMMENT 'GLUE更新时间',
|
||||
|
@ -184,8 +184,9 @@ CREATE TABLE `XXL_JOB_QRTZ_TRIGGER_LOG` (
|
|||
CREATE TABLE `XXL_JOB_QRTZ_TRIGGER_LOGGLUE` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`job_id` int(11) NOT NULL COMMENT '任务,主键ID',
|
||||
`glue_source` text,
|
||||
`glue_remark` varchar(128) NOT NULL,
|
||||
`glue_type` varchar(50) DEFAULT NULL COMMENT 'GLUE类型',
|
||||
`glue_source` text COMMENT 'GLUE源代码',
|
||||
`glue_remark` varchar(128) NOT NULL COMMENT 'GLUE备注',
|
||||
`add_time` timestamp NULL DEFAULT NULL,
|
||||
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`)
|
||||
|
|
|
@ -59,6 +59,7 @@ public class JobCodeController {
|
|||
// log old code
|
||||
XxlJobLogGlue xxlJobLogGlue = new XxlJobLogGlue();
|
||||
xxlJobLogGlue.setJobId(exists_jobInfo.getId());
|
||||
xxlJobLogGlue.setGlueType(exists_jobInfo.getGlueType());
|
||||
xxlJobLogGlue.setGlueSource(exists_jobInfo.getGlueSource());
|
||||
xxlJobLogGlue.setGlueRemark(exists_jobInfo.getGlueRemark());
|
||||
xxlJobLogGlueDao.save(xxlJobLogGlue);
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.xxl.job.admin.core.route.ExecutorRouteStrategyEnum;
|
|||
import com.xxl.job.admin.dao.IXxlJobGroupDao;
|
||||
import com.xxl.job.admin.service.IXxlJobService;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.glue.GlueTypeEnum;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -35,6 +36,9 @@ public class JobInfoController {
|
|||
// 路由策略-列表
|
||||
model.addAttribute("ExecutorRouteStrategyEnum", ExecutorRouteStrategyEnum.values());
|
||||
|
||||
// Glue类型-字典
|
||||
model.addAttribute("GlueTypeEnum", GlueTypeEnum.values());
|
||||
|
||||
// 任务组
|
||||
List<XxlJobGroup> jobGroupList = xxlJobGroupDao.findAll();
|
||||
model.addAttribute("JobGroupList", jobGroupList);
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.xxl.job.admin.core.thread.JobRegistryHelper;
|
|||
import com.xxl.job.core.biz.ExecutorBiz;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.biz.model.TriggerParam;
|
||||
import com.xxl.job.core.glue.GlueTypeEnum;
|
||||
import com.xxl.job.core.registry.RegistHelper;
|
||||
import com.xxl.job.core.rpc.netcom.NetComClientProxy;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
@ -59,7 +60,7 @@ public class RemoteHttpJobBean extends QuartzJobBean {
|
|||
triggerParam.setJobId(jobInfo.getId());
|
||||
triggerParam.setExecutorHandler(jobInfo.getExecutorHandler());
|
||||
triggerParam.setExecutorParams(jobInfo.getExecutorParam());
|
||||
triggerParam.setGlueSwitch((jobInfo.getGlueSwitch()==0)?false:true);
|
||||
triggerParam.setGlueType(jobInfo.getGlueType());
|
||||
triggerParam.setGlueUpdatetime(jobInfo.getGlueUpdatetime().getTime());
|
||||
triggerParam.setLogId(jobLog.getId());
|
||||
triggerParam.setLogDateTim(jobLog.getTriggerTime().getTime());
|
||||
|
|
|
@ -24,10 +24,10 @@ public class XxlJobInfo {
|
|||
private String executorHandler; // 执行器,任务Handler名称
|
||||
private String executorParam; // 执行器,任务参数
|
||||
|
||||
private int glueSwitch; // GLUE模式开关:0-否,1-是
|
||||
private String glueType; // GLUE类型 #com.xxl.job.core.glue.GlueTypeEnum
|
||||
private String glueSource; // GLUE源代码
|
||||
private String glueRemark; // GLUE备注
|
||||
private Date glueUpdatetime;// GLUE更新时间
|
||||
private Date glueUpdatetime; // GLUE更新时间
|
||||
|
||||
private String childJobKey; // 子任务Key
|
||||
|
||||
|
@ -122,12 +122,12 @@ public class XxlJobInfo {
|
|||
this.executorParam = executorParam;
|
||||
}
|
||||
|
||||
public int getGlueSwitch() {
|
||||
return glueSwitch;
|
||||
public String getGlueType() {
|
||||
return glueType;
|
||||
}
|
||||
|
||||
public void setGlueSwitch(int glueSwitch) {
|
||||
this.glueSwitch = glueSwitch;
|
||||
public void setGlueType(String glueType) {
|
||||
this.glueType = glueType;
|
||||
}
|
||||
|
||||
public String getGlueSource() {
|
||||
|
|
|
@ -8,6 +8,7 @@ public class XxlJobLogGlue {
|
|||
|
||||
private int id;
|
||||
private int jobId; // 任务主键ID
|
||||
private String glueType; // GLUE类型 #com.xxl.job.core.glue.GlueTypeEnum
|
||||
private String glueSource;
|
||||
private String glueRemark;
|
||||
private String addTime;
|
||||
|
@ -29,6 +30,14 @@ public class XxlJobLogGlue {
|
|||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getGlueType() {
|
||||
return glueType;
|
||||
}
|
||||
|
||||
public void setGlueType(String glueType) {
|
||||
this.glueType = glueType;
|
||||
}
|
||||
|
||||
public String getGlueSource() {
|
||||
return glueSource;
|
||||
}
|
||||
|
@ -61,15 +70,4 @@ public class XxlJobLogGlue {
|
|||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "XxlJobLogGlue{" +
|
||||
"id=" + id +
|
||||
", jobId=" + jobId +
|
||||
", glueSource='" + glueSource + '\'' +
|
||||
", glueRemark='" + glueRemark + '\'' +
|
||||
", addTime='" + addTime + '\'' +
|
||||
", updateTime='" + updateTime + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.xxl.job.admin.core.thread.JobRegistryHelper;
|
|||
import com.xxl.job.admin.dao.*;
|
||||
import com.xxl.job.admin.service.IXxlJobService;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.glue.GlueTypeEnum;
|
||||
import com.xxl.job.core.registry.RegistHelper;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
@ -84,7 +85,10 @@ public class XxlJobServiceImpl implements IXxlJobService {
|
|||
if (ExecutorRouteStrategyEnum.match(jobInfo.getExecutorRouteStrategy(), null) == null) {
|
||||
return new ReturnT<String>(500, "路由策略非法");
|
||||
}
|
||||
if (jobInfo.getGlueSwitch()==0 && StringUtils.isBlank(jobInfo.getExecutorHandler())) {
|
||||
if (GlueTypeEnum.match(jobInfo.getGlueType()) == null) {
|
||||
return new ReturnT<String>(500, "运行模式非法非法");
|
||||
}
|
||||
if (GlueTypeEnum.BEAN==GlueTypeEnum.match(jobInfo.getGlueType()) && StringUtils.isBlank(jobInfo.getExecutorHandler())) {
|
||||
return new ReturnT<String>(500, "请输入“JobHandler”");
|
||||
}
|
||||
|
||||
|
@ -147,7 +151,11 @@ public class XxlJobServiceImpl implements IXxlJobService {
|
|||
if (ExecutorRouteStrategyEnum.match(jobInfo.getExecutorRouteStrategy(), null) == null) {
|
||||
return new ReturnT<String>(500, "路由策略非法");
|
||||
}
|
||||
if (jobInfo.getGlueSwitch()==0 && StringUtils.isBlank(jobInfo.getExecutorHandler())) {
|
||||
|
||||
if (GlueTypeEnum.match(jobInfo.getGlueType()) == null) {
|
||||
return new ReturnT<String>(500, "运行模式非法非法");
|
||||
}
|
||||
if (GlueTypeEnum.BEAN==GlueTypeEnum.match(jobInfo.getGlueType()) && StringUtils.isBlank(jobInfo.getExecutorHandler())) {
|
||||
return new ReturnT<String>(500, "请输入“JobHandler”");
|
||||
}
|
||||
|
||||
|
@ -180,7 +188,7 @@ public class XxlJobServiceImpl implements IXxlJobService {
|
|||
exists_jobInfo.setExecutorRouteStrategy(jobInfo.getExecutorRouteStrategy());
|
||||
exists_jobInfo.setExecutorHandler(jobInfo.getExecutorHandler());
|
||||
exists_jobInfo.setExecutorParam(jobInfo.getExecutorParam());
|
||||
exists_jobInfo.setGlueSwitch(jobInfo.getGlueSwitch());
|
||||
exists_jobInfo.setGlueType(jobInfo.getGlueType());
|
||||
exists_jobInfo.setChildJobKey(jobInfo.getChildJobKey());
|
||||
xxlJobInfoDao.update(exists_jobInfo);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<result column="executor_handler" property="executorHandler" />
|
||||
<result column="executor_param" property="executorParam" />
|
||||
|
||||
<result column="glue_switch" property="glueSwitch" />
|
||||
<result column="glue_type" property="glueType" />
|
||||
<result column="glue_source" property="glueSource" />
|
||||
<result column="glue_remark" property="glueRemark" />
|
||||
<result column="glue_updatetime" property="glueUpdatetime" />
|
||||
|
@ -40,7 +40,7 @@
|
|||
t.executor_route_strategy,
|
||||
t.executor_handler,
|
||||
t.executor_param,
|
||||
t.glue_switch,
|
||||
t.glue_type,
|
||||
t.glue_source,
|
||||
t.glue_remark,
|
||||
t.glue_updatetime,
|
||||
|
@ -87,7 +87,7 @@
|
|||
executor_route_strategy,
|
||||
executor_handler,
|
||||
executor_param,
|
||||
glue_switch,
|
||||
glue_type,
|
||||
glue_source,
|
||||
glue_remark,
|
||||
glue_updatetime,
|
||||
|
@ -103,7 +103,7 @@
|
|||
#{executorRouteStrategy},
|
||||
#{executorHandler},
|
||||
#{executorParam},
|
||||
#{glueSwitch},
|
||||
#{glueType},
|
||||
#{glueSource},
|
||||
#{glueRemark},
|
||||
NOW(),
|
||||
|
@ -132,7 +132,7 @@
|
|||
executor_route_strategy = #{executorRouteStrategy},
|
||||
executor_handler = #{executorHandler},
|
||||
executor_param = #{executorParam},
|
||||
glue_switch = #{glueSwitch},
|
||||
glue_type = #{glueType},
|
||||
glue_source = #{glueSource},
|
||||
glue_remark = #{glueRemark},
|
||||
glue_updatetime = #{glueUpdatetime},
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<resultMap id="XxlJobLogGlue" type="com.xxl.job.admin.core.model.XxlJobLogGlue" >
|
||||
<result column="id" property="id" />
|
||||
<result column="job_id" property="jobId" />
|
||||
<result column="glue_type" property="glueType" />
|
||||
<result column="glue_source" property="glueSource" />
|
||||
<result column="glue_remark" property="glueRemark" />
|
||||
<result column="add_time" property="addTime" />
|
||||
|
@ -15,6 +16,7 @@
|
|||
<sql id="Base_Column_List">
|
||||
t.id,
|
||||
t.job_id,
|
||||
t.glue_type,
|
||||
t.glue_source,
|
||||
t.glue_remark,
|
||||
t.add_time,
|
||||
|
@ -24,12 +26,14 @@
|
|||
<insert id="save" parameterType="com.xxl.job.admin.core.model.XxlJobLogGlue" useGeneratedKeys="true" keyProperty="id" >
|
||||
INSERT INTO XXL_JOB_QRTZ_TRIGGER_LOGGLUE (
|
||||
`job_id`,
|
||||
`glue_type`,
|
||||
`glue_source`,
|
||||
`glue_remark`,
|
||||
`add_time`,
|
||||
`update_time`
|
||||
) VALUES (
|
||||
#{jobId},
|
||||
#{glueType},
|
||||
#{glueSource},
|
||||
#{glueRemark},
|
||||
now(),
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
<th name="updateTime" >更新时间</th>
|
||||
<th name="author" >负责人</th>
|
||||
<th name="alarmEmail" >报警邮件</th>
|
||||
<th name="glueSwitch" >GLUE模式</th>
|
||||
<th name="glueType" >运行模式</th>
|
||||
<th name="jobStatus" >状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
|
@ -136,16 +136,22 @@
|
|||
<div class="col-sm-4"><input type="text" class="form-control" name="jobCron" placeholder="请输入“Cron”" maxlength="20" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="firstname" class="col-sm-2 control-label">JobHandler<font color="red">*</font></label>
|
||||
<label for="firstname" class="col-sm-2 control-label">运行模式<font color="red">*</font></label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="executorHandler" placeholder="请输入“JobHandler”" maxlength="100" >
|
||||
<span class="input-group-addon"><b>GLUE</b> <input type="checkbox" class="ifGLUE" ></span>
|
||||
<input type="hidden" name="glueSwitch" value="0" >
|
||||
<select class="form-control glueType" name="glueType" >
|
||||
<#list GlueTypeEnum as item>
|
||||
<option value="${item}" >${item.desc}</option>
|
||||
</#list>
|
||||
</select>
|
||||
</div>
|
||||
<label for="firstname" class="col-sm-2 control-label">JobHandler<font color="black">*</font></label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="executorHandler" placeholder="请输入“JobHandler”" maxlength="100" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="firstname" class="col-sm-2 control-label">执行参数<font color="black">*</font></label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="executorParam" placeholder="请输入“执行参数”" maxlength="100" ></div>
|
||||
<label for="lastname" class="col-sm-2 control-label">子任务Key<font color="black">*</font></label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="childJobKey" placeholder="请输入子任务的任务Key,如存在多个逗号分隔" maxlength="100" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lastname" class="col-sm-2 control-label">报警邮件<font color="red">*</font></label>
|
||||
|
@ -153,10 +159,7 @@
|
|||
<label for="lastname" class="col-sm-2 control-label">负责人<font color="red">*</font></label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="请输入“负责人”" maxlength="50" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lastname" class="col-sm-2 control-label">子任务Key<font color="black">*</font></label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="childJobKey" placeholder="请输入子任务的任务Key,如存在多个逗号分隔" maxlength="100" ></div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-6">
|
||||
|
@ -227,16 +230,22 @@ public class DemoGlueJobHandler extends IJobHandler {
|
|||
<div class="col-sm-4"><input type="text" class="form-control" name="jobCron" placeholder="请输入“Cron”" maxlength="20" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="firstname" class="col-sm-2 control-label">JobHandler<font color="red">*</font></label>
|
||||
<label for="firstname" class="col-sm-2 control-label">运行模式<font color="red">*</font></label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="executorHandler" placeholder="请输入“JobHandler”" maxlength="100" >
|
||||
<span class="input-group-addon"><b>GLUE</b> <input type="checkbox" class="ifGLUE" ></span>
|
||||
<input type="hidden" name="glueSwitch" value="0" >
|
||||
<select class="form-control glueType" name="glueType" >
|
||||
<#list GlueTypeEnum as item>
|
||||
<option value="${item}" >${item.desc}</option>
|
||||
</#list>
|
||||
</select>
|
||||
</div>
|
||||
<label for="firstname" class="col-sm-2 control-label">JobHandler<font color="black">*</font></label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="executorHandler" placeholder="请输入“JobHandler”" maxlength="100" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="firstname" class="col-sm-2 control-label">执行参数<font color="black">*</font></label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="executorParam" placeholder="请输入“执行参数”" maxlength="100" ></div>
|
||||
<label for="lastname" class="col-sm-2 control-label">子任务Key<font color="black">*</font></label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="childJobKey" placeholder="请输入子任务的任务Key,如存在多个逗号分隔" maxlength="100" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lastname" class="col-sm-2 control-label">报警邮件<font color="red">*</font></label>
|
||||
|
@ -244,10 +253,7 @@ public class DemoGlueJobHandler extends IJobHandler {
|
|||
<label for="lastname" class="col-sm-2 control-label">负责人<font color="red">*</font></label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="请输入“负责人”" maxlength="50" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lastname" class="col-sm-2 control-label">子任务Key<font color="black">*</font></label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="childJobKey" placeholder="请输入子任务的任务Key,如存在多个逗号分隔" maxlength="100" ></div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-6">
|
||||
|
|
|
@ -70,7 +70,7 @@ $(function() {
|
|||
},
|
||||
{ "data": 'author', "visible" : true, "width":'10%'},
|
||||
{ "data": 'alarmEmail', "visible" : false},
|
||||
{ "data": 'glueSwitch', "visible" : false},
|
||||
{ "data": 'glueType', "visible" : false},
|
||||
{
|
||||
"data": 'jobStatus',
|
||||
"width":'10%',
|
||||
|
@ -103,7 +103,7 @@ $(function() {
|
|||
|
||||
// log url
|
||||
var codeBtn = "";
|
||||
if(row.glueSwitch > 0){
|
||||
if ('BEAN' != row.glueType) {
|
||||
var codeUrl = base_url +'/jobcode?jobId='+ row.id;
|
||||
codeBtn = '<button class="btn btn-warning btn-xs" type="button" onclick="javascript:window.open(\'' + codeUrl + '\')" >GLUE</button> '
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ $(function() {
|
|||
' executorRouteStrategy="'+row.executorRouteStrategy +'" '+
|
||||
' executorHandler="'+row.executorHandler +'" '+
|
||||
' executorParam="'+ row.executorParam +'" '+
|
||||
' glueSwitch="'+ row.glueSwitch +'" '+
|
||||
' glueType="'+ row.glueType +'" '+
|
||||
' childJobKey="'+ row.childJobKey +'" '+
|
||||
'>'+
|
||||
'<button class="btn btn-primary btn-xs job_operate" type="job_trigger" type="button">执行</button> '+
|
||||
|
@ -240,9 +240,6 @@ $(function() {
|
|||
jobCron : {
|
||||
required : true
|
||||
},
|
||||
executorHandler : {
|
||||
required : false
|
||||
},
|
||||
alarmEmail : {
|
||||
required : true
|
||||
},
|
||||
|
@ -257,9 +254,6 @@ $(function() {
|
|||
jobCron : {
|
||||
required :"请输入“Cron”."
|
||||
},
|
||||
executorHandler : {
|
||||
required : "请输入“jobHandler”."
|
||||
},
|
||||
alarmEmail : {
|
||||
required : "请输入“报警邮件”."
|
||||
},
|
||||
|
@ -306,18 +300,17 @@ $(function() {
|
|||
$("#addModal .form input[name='executorHandler']").removeAttr("readonly");
|
||||
});
|
||||
|
||||
|
||||
// GLUE模式开启
|
||||
$(".ifGLUE").click(function(){
|
||||
var ifGLUE = $(this).is(':checked');
|
||||
$(".glueType").change(function(){
|
||||
var $executorHandler = $(this).parents("form").find("input[name='executorHandler']");
|
||||
var $glueSwitch = $(this).parents("form").find("input[name='glueSwitch']");
|
||||
if (ifGLUE) {
|
||||
var glueType = $(this).val();
|
||||
console.log(glueType);
|
||||
if ('BEAN' != glueType) {
|
||||
$executorHandler.val("");
|
||||
$executorHandler.attr("readonly","readonly");
|
||||
$glueSwitch.val(1);
|
||||
} else {
|
||||
$executorHandler.removeAttr("readonly");
|
||||
$glueSwitch.val(0);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -335,20 +328,10 @@ $(function() {
|
|||
$("#updateModal .form input[name='executorHandler']").val($(this).parent('p').attr("executorHandler"));
|
||||
$("#updateModal .form input[name='executorParam']").val($(this).parent('p').attr("executorParam"));
|
||||
$("#updateModal .form input[name='childJobKey']").val($(this).parent('p').attr("childJobKey"));
|
||||
$('#updateModal .form select[name=glueType] option[value='+ $(this).parent('p').attr("glueType") +']').prop('selected', true);
|
||||
|
||||
// glueSwitch
|
||||
var glueSwitch = $(this).parent('p').attr("glueSwitch");
|
||||
$("#updateModal .form input[name='glueSwitch']").val(glueSwitch);
|
||||
var $ifGLUE = $("#updateModal .form .ifGLUE");
|
||||
var $executorHandler = $("#updateModal .form input[name='executorHandler']");
|
||||
if (glueSwitch == 1) {
|
||||
$ifGLUE.attr("checked", true);
|
||||
$executorHandler.val("");
|
||||
$executorHandler.attr("readonly","readonly");
|
||||
} else {
|
||||
$ifGLUE.attr("checked", false);
|
||||
$executorHandler.removeAttr("readonly");
|
||||
}
|
||||
|
||||
$("#updateModal .form select[name=glueType]").change();
|
||||
|
||||
// show
|
||||
$('#updateModal').modal({backdrop: false, keyboard: false}).modal('show');
|
||||
|
@ -366,9 +349,6 @@ $(function() {
|
|||
jobCron : {
|
||||
required : true
|
||||
},
|
||||
executorHandler : {
|
||||
required : false
|
||||
},
|
||||
alarmEmail : {
|
||||
required : true
|
||||
},
|
||||
|
@ -383,9 +363,6 @@ $(function() {
|
|||
jobCron : {
|
||||
required :"请输入“Cron”."
|
||||
},
|
||||
executorHandler : {
|
||||
required : "请输入“jobHandler”."
|
||||
},
|
||||
alarmEmail : {
|
||||
required : "请输入“报警邮件”."
|
||||
},
|
||||
|
@ -428,21 +405,4 @@ $(function() {
|
|||
$("#updateModal .form")[0].reset()
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
// 新增-添加参数
|
||||
$("#addModal .addParam").on('click', function () {
|
||||
var html = '<div class="form-group newParam">'+
|
||||
'<label for="lastname" class="col-sm-2 control-label">参数 <button class="btn btn-danger btn-xs removeParam" type="button">移除</button></label>'+
|
||||
'<div class="col-sm-4"><input type="text" class="form-control" name="key" placeholder="请输入参数key[将会强转为String]" maxlength="200" /></div>'+
|
||||
'<div class="col-sm-6"><input type="text" class="form-control" name="value" placeholder="请输入参数value[将会强转为String]" maxlength="200" /></div>'+
|
||||
'</div>';
|
||||
$(this).parents('.form-group').parent().append(html);
|
||||
|
||||
$("#addModal .removeParam").on('click', function () {
|
||||
$(this).parents('.form-group').remove();
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
});
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.xxl.job.core.biz.model.ReturnT;
|
|||
import com.xxl.job.core.biz.model.TriggerParam;
|
||||
import com.xxl.job.core.executor.XxlJobExecutor;
|
||||
import com.xxl.job.core.glue.GlueFactory;
|
||||
import com.xxl.job.core.glue.GlueTypeEnum;
|
||||
import com.xxl.job.core.handler.IJobHandler;
|
||||
import com.xxl.job.core.handler.impl.GlueJobHandler;
|
||||
import com.xxl.job.core.log.XxlJobFileAppender;
|
||||
|
@ -56,7 +57,7 @@ public class ExecutorBizImpl implements ExecutorBiz {
|
|||
// load old thread
|
||||
JobThread jobThread = XxlJobExecutor.loadJobThread(triggerParam.getJobId());
|
||||
|
||||
if (!triggerParam.isGlueSwitch()) {
|
||||
if (GlueTypeEnum.BEAN==GlueTypeEnum.match(triggerParam.getGlueType())) {
|
||||
// bean model
|
||||
|
||||
// valid handler
|
||||
|
|
|
@ -14,7 +14,7 @@ public class TriggerParam implements Serializable{
|
|||
private String executorHandler;
|
||||
private String executorParams;
|
||||
|
||||
private boolean glueSwitch;
|
||||
private String glueType;
|
||||
private long glueUpdatetime;
|
||||
|
||||
private int logId;
|
||||
|
@ -46,12 +46,12 @@ public class TriggerParam implements Serializable{
|
|||
this.executorParams = executorParams;
|
||||
}
|
||||
|
||||
public boolean isGlueSwitch() {
|
||||
return glueSwitch;
|
||||
public String getGlueType() {
|
||||
return glueType;
|
||||
}
|
||||
|
||||
public void setGlueSwitch(boolean glueSwitch) {
|
||||
this.glueSwitch = glueSwitch;
|
||||
public void setGlueType(String glueType) {
|
||||
this.glueType = glueType;
|
||||
}
|
||||
|
||||
public long getGlueUpdatetime() {
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package com.xxl.job.core.glue;
|
||||
|
||||
/**
|
||||
* Created by xuxueli on 17/4/26.
|
||||
*/
|
||||
public enum GlueTypeEnum {
|
||||
|
||||
BEAN("BEAN模式"),
|
||||
GLUE_GROOVY("GLUE模式(Java)"),
|
||||
GLUE_SHELL("GLUE模式(Shell)"),
|
||||
GLUE_PYTHON("GLUE模式(Python)");
|
||||
|
||||
private String desc;
|
||||
private GlueTypeEnum(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static GlueTypeEnum match(String name){
|
||||
for (GlueTypeEnum item: GlueTypeEnum.values()) {
|
||||
if (item.name().equals(name)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -107,6 +107,9 @@ public class JobThread extends Thread{
|
|||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (toStop) {
|
||||
logger.error("----------- xxl-job toStop, stopReason:{}", stopReason);
|
||||
}
|
||||
logger.error("----------- xxl-job JobThread Exception:", e);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue