revert[proxy]: bean should be pojo class

This commit is contained in:
godotg committed 2023-01-17 11:18:52 +08:00
1 parent 06f716feb9
commit 607314a442
7 files changed
+29 -23

No files matched your search

@@ -43,11 +43,15 @@ public class EventRegisterProcessor implements BeanPostProcessor {
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
var clazz = bean.getClass();
var methods = ReflectionUtils.getMethodsByAnnotation(clazz, EventReceiver.class);
var methods = ReflectionUtils.getMethodsByAnnoInPOJOClass(clazz, EventReceiver.class);
if (ArrayUtils.isEmpty(methods)) {
return bean;
}
if (!ReflectionUtils.isPojoClass(clazz)) {
logger.warn("The message registration class [{}] is not a POJO class, and the parent class will not be scanned", clazz);
}
try {
for (var method : methods) {
var paramClazzs = method.getParameterTypes();