|
|
|
@ -9,7 +9,7 @@ import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.beans.BeansException; |
|
|
|
|
import org.springframework.beans.factory.DisposableBean; |
|
|
|
|
import org.springframework.beans.factory.InitializingBean; |
|
|
|
|
import org.springframework.beans.factory.SmartInitializingSingleton; |
|
|
|
|
import org.springframework.context.ApplicationContext; |
|
|
|
|
import org.springframework.context.ApplicationContextAware; |
|
|
|
|
import org.springframework.core.MethodIntrospector; |
|
|
|
@ -24,13 +24,13 @@ import java.util.Map; |
|
|
|
|
* |
|
|
|
|
* @author xuxueli 2018-11-01 09:24:52 |
|
|
|
|
*/ |
|
|
|
|
public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationContextAware, InitializingBean, DisposableBean { |
|
|
|
|
public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationContextAware, SmartInitializingSingleton, DisposableBean { |
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(XxlJobSpringExecutor.class); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// start
|
|
|
|
|
@Override |
|
|
|
|
public void afterPropertiesSet() throws Exception { |
|
|
|
|
public void afterSingletonsInstantiated() { |
|
|
|
|
|
|
|
|
|
// init JobHandler Repository
|
|
|
|
|
/*initJobHandlerRepository(applicationContext);*/ |
|
|
|
@ -42,7 +42,11 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC |
|
|
|
|
GlueFactory.refreshInstance(1); |
|
|
|
|
|
|
|
|
|
// super start
|
|
|
|
|
super.start(); |
|
|
|
|
try { |
|
|
|
|
super.start(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// destroy
|
|
|
|
@ -93,7 +97,7 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} catch (Throwable ex) { |
|
|
|
|
logger.debug("xxl-job method-jobhandler resolve error for bean[" + beanDefinitionName + "].", ex); |
|
|
|
|
logger.error("xxl-job method-jobhandler resolve error for bean[" + beanDefinitionName + "].", ex); |
|
|
|
|
} |
|
|
|
|
if (annotatedMethods==null || annotatedMethods.isEmpty()) { |
|
|
|
|
continue; |
|
|
|
|