|
|
@ -8,6 +8,7 @@ import com.xxl.job.admin.dao.IXxlJobGroupDao; |
|
|
|
import com.xxl.job.admin.dao.IXxlJobInfoDao; |
|
|
|
import com.xxl.job.admin.dao.IXxlJobInfoDao; |
|
|
|
import com.xxl.job.admin.dao.IXxlJobLogDao; |
|
|
|
import com.xxl.job.admin.dao.IXxlJobLogDao; |
|
|
|
import com.xxl.job.admin.dao.IXxlJobRegistryDao; |
|
|
|
import com.xxl.job.admin.dao.IXxlJobRegistryDao; |
|
|
|
|
|
|
|
import com.xxl.job.core.util.IpUtil; |
|
|
|
import org.quartz.*; |
|
|
|
import org.quartz.*; |
|
|
|
import org.quartz.Trigger.TriggerState; |
|
|
|
import org.quartz.Trigger.TriggerState; |
|
|
|
import org.quartz.impl.matchers.GroupMatcher; |
|
|
|
import org.quartz.impl.matchers.GroupMatcher; |
|
|
@ -35,11 +36,20 @@ public final class DynamicSchedulerUtil implements ApplicationContextAware, Init |
|
|
|
DynamicSchedulerUtil.scheduler = scheduler; |
|
|
|
DynamicSchedulerUtil.scheduler = scheduler; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// trigger callback port
|
|
|
|
// trigger callback address
|
|
|
|
|
|
|
|
private String callBackIp; |
|
|
|
private int callBackPort = 8888; |
|
|
|
private int callBackPort = 8888; |
|
|
|
|
|
|
|
private static String callbackAddress; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setCallBackIp(String callBackIp) { |
|
|
|
|
|
|
|
this.callBackIp = callBackIp; |
|
|
|
|
|
|
|
} |
|
|
|
public void setCallBackPort(int callBackPort) { |
|
|
|
public void setCallBackPort(int callBackPort) { |
|
|
|
this.callBackPort = callBackPort; |
|
|
|
this.callBackPort = callBackPort; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static String getCallbackAddress(){ |
|
|
|
|
|
|
|
return callbackAddress; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// init
|
|
|
|
// init
|
|
|
|
XxlJobLogCallbackServer xxlJobLogCallbackServer = null; |
|
|
|
XxlJobLogCallbackServer xxlJobLogCallbackServer = null; |
|
|
@ -52,6 +62,13 @@ public final class DynamicSchedulerUtil implements ApplicationContextAware, Init |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// init callbackAddress
|
|
|
|
|
|
|
|
if (callBackIp!=null && callBackIp.trim().length()>0) { |
|
|
|
|
|
|
|
callbackAddress = callBackIp.trim().concat(":").concat(String.valueOf(callBackPort)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
callbackAddress = IpUtil.getIpPort(callBackPort);; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// init JobRegistryHelper
|
|
|
|
// init JobRegistryHelper
|
|
|
|
JobRegistryHelper.discover("g", "k"); |
|
|
|
JobRegistryHelper.discover("g", "k"); |
|
|
|
} |
|
|
|
} |
|
|
|