提交 ff8e43af 编写于 作者: 许雪里's avatar 许雪里

调度中心API服务改为自研RPC形式,统一底层通讯模型;

上级 ee07e0b7
package com.xxl.job.admin.controller;
import com.xxl.job.admin.controller.annotation.PermessionLimit;
import com.xxl.job.admin.core.schedule.XxlJobDynamicScheduler;
import com.xxl.job.core.biz.AdminBiz;
import com.xxl.job.core.rpc.codec.RpcRequest;
import com.xxl.job.core.rpc.codec.RpcResponse;
import com.xxl.job.core.rpc.netcom.NetComServerFactory;
......@@ -25,10 +23,6 @@ import java.io.OutputStream;
public class JobApiController {
private static Logger logger = LoggerFactory.getLogger(JobApiController.class);
static {
NetComServerFactory.putService(AdminBiz.class, XxlJobDynamicScheduler.adminBiz);
}
private RpcResponse doInvoke(HttpServletRequest request) {
try {
// deserialize request
......
......@@ -38,13 +38,15 @@ public final class XxlJobDynamicScheduler implements ApplicationContextAware, In
}
// init
private NetComServerFactory serverFactory = new NetComServerFactory();
public void init() throws Exception {
// admin registry monitor run
JobRegistryMonitorHelper.getInstance().start();
// admin monitor run
JobFailMonitorHelper.getInstance().start();
// rpc-service, base on spring-mvc
NetComServerFactory.putService(AdminBiz.class, XxlJobDynamicScheduler.adminBiz);
}
// destroy
......@@ -54,8 +56,6 @@ public final class XxlJobDynamicScheduler implements ApplicationContextAware, In
// admin monitor stop
JobFailMonitorHelper.getInstance().toStop();
serverFactory.destroy();
}
// xxlJobLogDao、xxlJobInfoDao
......
......@@ -52,7 +52,7 @@ public class XxlJobExecutor implements ApplicationContextAware, ApplicationListe
private NetComServerFactory serverFactory = new NetComServerFactory();
public void start() throws Exception {
// executor start
NetComServerFactory.putService(ExecutorBiz.class, new ExecutorBizImpl());
NetComServerFactory.putService(ExecutorBiz.class, new ExecutorBizImpl()); // rpc-service, base on jetty
serverFactory.start(port, ip, appName);
// trigger callback thread start
......
......@@ -21,7 +21,7 @@ public class JettyClient {
// reqURL
String reqURL = request.getServerAddress();
if (reqURL!=null && reqURL.indexOf("http://")==-1) {
if (reqURL!=null && reqURL.toLowerCase().indexOf("http://")==-1) {
reqURL = "http://" + request.getServerAddress() + "/";
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册