fix[proxy]: the annotations of the bean of the parent class cannot be scanned

This commit is contained in:
sun committed 2023-01-16 19:11:19 +08:00
1 parent e2522ac333
commit 06f716feb9
5 files changed
+6 -28

No files matched your search

@@ -101,16 +101,12 @@ public class SchedulerContext implements ApplicationListener<ApplicationContextE
var bean = applicationContext.getBean(beanName);
var clazz = bean.getClass();
var methods = ReflectionUtils.getMethodsByAnnoInPOJOClass(bean.getClass(), Scheduler.class);
var methods = ReflectionUtils.getMethodsByAnnotation(clazz, Scheduler.class);
if (ArrayUtils.isEmpty(methods)) {
continue;
}
if (!ReflectionUtils.isPojoClass(clazz)) {
logger.warn("调度注册类[{}]不是POJO类,父类的调度不会被扫描到", clazz);
}
try {
for (var method : methods) {
var schedulerMethod = method.getAnnotation(Scheduler.class);