|
|
|
@ -13,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.beans.BeansException;
|
|
|
|
import org.springframework.beans.BeansException;
|
|
|
|
import org.springframework.beans.factory.config.BeanPostProcessor;
|
|
|
|
import org.springframework.beans.factory.config.BeanPostProcessor;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
|
|
|
import org.springframework.core.Ordered;
|
|
|
|
|
|
|
|
import org.springframework.core.PriorityOrdered;
|
|
|
|
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.lang.reflect.Parameter;
|
|
|
|
import java.lang.reflect.Parameter;
|
|
|
|
@ -21,13 +23,13 @@ import java.util.List;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.TreeSet;
|
|
|
|
import java.util.TreeSet;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Getter
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
@Slf4j
|
|
|
|
@Slf4j
|
|
|
|
public class CronBeanPostProcessor implements BeanPostProcessor {
|
|
|
|
public class CronBeanPostProcessor implements BeanPostProcessor, PriorityOrdered {
|
|
|
|
|
|
|
|
|
|
|
|
@Getter
|
|
|
|
private final List<CronTaskVo> list = ListUtil.list(true);
|
|
|
|
private List<CronTaskVo> list = ListUtil.list(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
|
|
|
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
|
|
|
@ -59,4 +61,8 @@ public class CronBeanPostProcessor implements BeanPostProcessor {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public int getOrder() {
|
|
|
|
|
|
|
|
return Ordered.HIGHEST_PRECEDENCE; // 最高优先级
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|