|
|
@ -24,6 +24,7 @@ import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
|
|
import java.util.concurrent.ConcurrentMap;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Created by xuxueli on 2016/3/2 21:14.
|
|
|
|
* Created by xuxueli on 2016/3/2 21:14.
|
|
|
@ -223,7 +224,7 @@ public class XxlJobExecutor {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ---------------------- job handler repository ----------------------
|
|
|
|
// ---------------------- job handler repository ----------------------
|
|
|
|
private static ConcurrentHashMap<String, IJobHandler> jobHandlerRepository = new ConcurrentHashMap<String, IJobHandler>();
|
|
|
|
private static ConcurrentMap<String, IJobHandler> jobHandlerRepository = new ConcurrentHashMap<String, IJobHandler>();
|
|
|
|
public static IJobHandler registJobHandler(String name, IJobHandler jobHandler){
|
|
|
|
public static IJobHandler registJobHandler(String name, IJobHandler jobHandler){
|
|
|
|
logger.info(">>>>>>>>>>> xxl-job register jobhandler success, name:{}, jobHandler:{}", name, jobHandler);
|
|
|
|
logger.info(">>>>>>>>>>> xxl-job register jobhandler success, name:{}, jobHandler:{}", name, jobHandler);
|
|
|
|
return jobHandlerRepository.put(name, jobHandler);
|
|
|
|
return jobHandlerRepository.put(name, jobHandler);
|
|
|
@ -234,7 +235,7 @@ public class XxlJobExecutor {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ---------------------- job thread repository ----------------------
|
|
|
|
// ---------------------- job thread repository ----------------------
|
|
|
|
private static ConcurrentHashMap<Integer, JobThread> jobThreadRepository = new ConcurrentHashMap<Integer, JobThread>();
|
|
|
|
private static ConcurrentMap<Integer, JobThread> jobThreadRepository = new ConcurrentHashMap<Integer, JobThread>();
|
|
|
|
public static JobThread registJobThread(int jobId, IJobHandler handler, String removeOldReason){
|
|
|
|
public static JobThread registJobThread(int jobId, IJobHandler handler, String removeOldReason){
|
|
|
|
JobThread newJobThread = new JobThread(jobId, handler);
|
|
|
|
JobThread newJobThread = new JobThread(jobId, handler);
|
|
|
|
newJobThread.start();
|
|
|
|
newJobThread.start();
|
|
|
|