|
@@ -1,4 +1,4 @@
|
|
|
-package com.xxl.job.client.netcom.jetty;
|
|
|
+package com.xxl.job.core.executor.jetty;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -14,15 +14,15 @@ import org.springframework.beans.BeansException;
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
import org.springframework.context.ApplicationContextAware;
|
|
|
|
|
|
-import com.xxl.job.client.handler.HandlerRepository;
|
|
|
-import com.xxl.job.client.handler.IJobHandler;
|
|
|
-import com.xxl.job.client.handler.annotation.JobHander;
|
|
|
+import com.xxl.job.core.handler.HandlerRepository;
|
|
|
+import com.xxl.job.core.handler.IJobHandler;
|
|
|
+import com.xxl.job.core.handler.annotation.JobHander;
|
|
|
|
|
|
/**
|
|
|
* Created by xuxueli on 2016/3/2 21:14.
|
|
|
*/
|
|
|
-public class XxlJobJettyServer implements ApplicationContextAware {
|
|
|
- private static final Logger logger = LoggerFactory.getLogger(XxlJobJettyServer.class);
|
|
|
+public class XxlJobExecutor implements ApplicationContextAware {
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(XxlJobExecutor.class);
|
|
|
|
|
|
private int port = 9999;
|
|
|
public void setPort(int port) {
|
|
@@ -45,7 +45,7 @@ public class XxlJobJettyServer implements ApplicationContextAware {
|
|
|
|
|
|
// handler
|
|
|
HandlerCollection handlerc =new HandlerCollection();
|
|
|
- handlerc.setHandlers(new Handler[]{new XxlJobJettyServerHandler()});
|
|
|
+ handlerc.setHandlers(new Handler[]{new XxlJobExecutorHandler()});
|
|
|
server.setHandler(handlerc);
|
|
|
|
|
|
try {
|
|
@@ -64,7 +64,7 @@ public class XxlJobJettyServer implements ApplicationContextAware {
|
|
|
public static ApplicationContext applicationContext;
|
|
|
@Override
|
|
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
|
|
- XxlJobJettyServer.applicationContext = applicationContext;
|
|
|
+ XxlJobExecutor.applicationContext = applicationContext;
|
|
|
initJobHandler();
|
|
|
}
|
|
|
|
|
@@ -72,7 +72,7 @@ public class XxlJobJettyServer implements ApplicationContextAware {
|
|
|
* init job handler service
|
|
|
*/
|
|
|
public void initJobHandler(){
|
|
|
- Map<String, Object> serviceBeanMap = XxlJobJettyServer.applicationContext.getBeansWithAnnotation(JobHander.class);
|
|
|
+ Map<String, Object> serviceBeanMap = XxlJobExecutor.applicationContext.getBeansWithAnnotation(JobHander.class);
|
|
|
if (serviceBeanMap!=null && serviceBeanMap.size()>0) {
|
|
|
for (Object serviceBean : serviceBeanMap.values()) {
|
|
|
String jobName = serviceBean.getClass().getAnnotation(JobHander.class).name();
|