启动日志
22:29:59.031 logback [main] INFO c.x.r.r.p.XxlRpcProviderFactory - >>>>>>>>>>> xxl-rpc, provider factory add service success. serviceKey = com.xxl.job.core.biz.AdminBiz, serviceBean = class com.xxl.job.admin.service.impl.AdminBizImpl
22:29:59.036 logback [main] INFO c.x.j.a.core.conf.XxlJobScheduler - >>>>>>>>> init xxl-job admin success.
22:29:59.438 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@16eccb2e: startup date [Sun Aug 04 22:29:54 CST 2019]; root of context hierarchy
22:29:59.503 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/help]}" onto public java.lang.String com.xxl.job.admin.controller.IndexController.help()
22:29:59.506 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/]}" onto public java.lang.String com.xxl.job.admin.controller.IndexController.index(org.springframework.ui.Model)
22:29:59.507 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/chartInfo]}" onto public com.xxl.job.core.biz.model.ReturnT<java.util.Map<java.lang.String, java.lang.Object>> com.xxl.job.admin.controller.IndexController.chartInfo(java.util.Date,java.util.Date)
22:29:59.507 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/logout],methods=[POST]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.IndexController.logout(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
22:29:59.508 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/toLogin]}" onto public java.lang.String com.xxl.job.admin.controller.IndexController.toLogin(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
22:29:59.508 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/login],methods=[POST]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.IndexController.loginDo(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.String,java.lang.String,java.lang.String)
22:29:59.509 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/api]}" onto public void com.xxl.job.admin.controller.JobApiController.api(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException
22:29:59.511 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobcode]}" onto public java.lang.String com.xxl.job.admin.controller.JobCodeController.index(javax.servlet.http.HttpServletRequest,org.springframework.ui.Model,int)
22:29:59.511 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobcode/save]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobCodeController.save(org.springframework.ui.Model,int,java.lang.String,java.lang.String)
22:29:59.513 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobgroup]}" onto public java.lang.String com.xxl.job.admin.controller.JobGroupController.index(org.springframework.ui.Model)
22:29:59.514 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobgroup/remove]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobGroupController.remove(int)
22:29:59.514 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobgroup/update]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobGroupController.update(com.xxl.job.admin.core.model.XxlJobGroup)
22:29:59.515 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobgroup/save]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobGroupController.save(com.xxl.job.admin.core.model.XxlJobGroup)
22:29:59.515 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobgroup/loadById]}" onto public com.xxl.job.core.biz.model.ReturnT<com.xxl.job.admin.core.model.XxlJobGroup> com.xxl.job.admin.controller.JobGroupController.loadById(int)
22:29:59.522 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobinfo]}" onto public java.lang.String com.xxl.job.admin.controller.JobInfoController.index(javax.servlet.http.HttpServletRequest,org.springframework.ui.Model,int)
22:29:59.522 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobinfo/add]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobInfoController.add(com.xxl.job.admin.core.model.XxlJobInfo)
22:29:59.523 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobinfo/remove]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobInfoController.remove(int)
22:29:59.524 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobinfo/update]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobInfoController.update(com.xxl.job.admin.core.model.XxlJobInfo)
22:29:59.524 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobinfo/start]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobInfoController.start(int)
22:29:59.524 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobinfo/pageList]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.xxl.job.admin.controller.JobInfoController.pageList(int,int,int,int,java.lang.String,java.lang.String,java.lang.String)
22:29:59.525 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobinfo/trigger]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobInfoController.triggerJob(int,java.lang.String)
22:29:59.525 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/jobinfo/stop]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobInfoController.pause(int)
22:29:59.529 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/joblog]}" onto public java.lang.String com.xxl.job.admin.controller.JobLogController.index(javax.servlet.http.HttpServletRequest,org.springframework.ui.Model,java.lang.Integer)
22:29:59.529 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/joblog/pageList]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.xxl.job.admin.controller.JobLogController.pageList(javax.servlet.http.HttpServletRequest,int,int,int,int,int,java.lang.String)
22:29:59.530 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/joblog/getJobsByGroup]}" onto public com.xxl.job.core.biz.model.ReturnT<java.util.List<com.xxl.job.admin.core.model.XxlJobInfo>> com.xxl.job.admin.controller.JobLogController.getJobsByGroup(int)
22:29:59.530 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/joblog/logDetailCat]}" onto public com.xxl.job.core.biz.model.ReturnT<com.xxl.job.core.biz.model.LogResult> com.xxl.job.admin.controller.JobLogController.logDetailCat(java.lang.String,long,long,int)
22:29:59.530 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/joblog/logDetailPage]}" onto public java.lang.String com.xxl.job.admin.controller.JobLogController.logDetailPage(int,org.springframework.ui.Model)
22:29:59.531 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/joblog/clearLog]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobLogController.clearLog(int,int,int)
22:29:59.531 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/joblog/logKill]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.JobLogController.logKill(int)
22:29:59.533 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/user]}" onto public java.lang.String com.xxl.job.admin.controller.UserController.index(org.springframework.ui.Model)
22:29:59.535 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/user/add]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.UserController.add(com.xxl.job.admin.core.model.XxlJobUser)
22:29:59.536 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/user/remove]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.UserController.remove(javax.servlet.http.HttpServletRequest,int)
22:29:59.537 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/user/update]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.UserController.update(javax.servlet.http.HttpServletRequest,com.xxl.job.admin.core.model.XxlJobUser)
22:29:59.537 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/user/pageList]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.xxl.job.admin.controller.UserController.pageList(int,int,java.lang.String,int)
22:29:59.538 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/user/updatePwd]}" onto public com.xxl.job.core.biz.model.ReturnT<java.lang.String> com.xxl.job.admin.controller.UserController.updatePwd(javax.servlet.http.HttpServletRequest,java.lang.String)
22:29:59.540 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
22:29:59.541 logback [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
22:29:59.582 logback [main] INFO o.s.w.s.h.SimpleUrlHandlerMapping - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
22:29:59.582 logback [main] INFO o.s.w.s.h.SimpleUrlHandlerMapping - Mapped URL path [/static/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
22:29:59.623 logback [main] INFO o.s.w.s.h.SimpleUrlHandlerMapping - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
22:29:59.903 logback [main] INFO o.s.w.s.v.f.FreeMarkerConfigurer - ClassTemplateLoader for Spring macros added to FreeMarker configuration
22:30:00.364 logback [main] INFO o.s.j.e.a.AnnotationMBeanExporter - Registering beans for JMX exposure on startup
22:30:00.629 logback [main] INFO o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-9001"]
22:30:00.799 logback [main] INFO o.a.tomcat.util.net.NioSelectorPool - Using a shared selector for servlet write/read
22:30:00.834 logback [main] INFO o.s.b.c.e.t.TomcatEmbeddedServletContainer - Tomcat started on port(s): 9001 (http)
22:30:00.844 logback [main] INFO c.x.job.admin.XxlJobAdminApplication - Started XxlJobAdminApplication in 6.379 seconds (JVM running for 12.187)
22:30:04.000 logback [xxl-job, admin JobScheduleHelper#scheduleThread] INFO c.x.j.a.c.thread.JobScheduleHelper - >>>>>>>>> init xxl-job admin scheduler success.
22:31:05.559 logback [http-nio-9001-exec-5] INFO o.a.c.c.C.[.[.[/xxl-job-admin] - Initializing Spring FrameworkServlet 'dispatcherServlet'
22:31:05.559 logback [http-nio-9001-exec-5] INFO o.s.web.servlet.DispatcherServlet - FrameworkServlet 'dispatcherServlet': initialization started
22:31:05.584 logback [http-nio-9001-exec-5] INFO o.s.web.servlet.DispatcherServlet - FrameworkServlet 'dispatcherServlet': initialization completed in 25 ms
启动流程
XxlJobScheduler初始化过程中调用afterPropertiesSet()方法
XxlJobScheduler.java
@Override
public void afterPropertiesSet() throws Exception {
initI18n();
JobRegistryMonitorHelper.getInstance().start();
JobFailMonitorHelper.getInstance().start();
initRpcProvider();
JobScheduleHelper.getInstance().start();
logger.info(">>>>>>>>> init xxl-job admin success.");
}
JobRegistryMonitorHelper
package com.xxl.job.admin.core.thread;
JobRegistryMonitorHelper.java
public void start(){
registryThread = new Thread(new Runnable() {
@Override
public void run() {
while (!toStop) {
try {
List<XxlJobGroup> groupList = XxlJobAdminConfig.getAdminConfig().getXxlJobGroupDao().findByAddressType(0);
if (groupList!=null && !groupList.isEmpty()) {
List<Integer> ids = XxlJobAdminConfig.getAdminConfig().getXxlJobRegistryDao().findDead(RegistryConfig.DEAD_TIMEOUT);
if (ids!=null && ids.size()>0) {
XxlJobAdminConfig.getAdminConfig()