mirror of https://gitee.com/stylefeng/roses
【8.3.0】【event】更新事件发布的过程
parent
785ace7ba1
commit
07db019f30
|
@ -67,12 +67,15 @@ public class BusinessEventPublisher {
|
|||
|
||||
// 如果发布事件的时候,包含参数,则判断method的第一个参数是否和businessObject的class一样,不一样则不调用
|
||||
else {
|
||||
if (parameterClassType != null && parameterClassType.equals(businessObject.getClass())) {
|
||||
try {
|
||||
listenerMethod.invoke(bean, businessObject);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
log.error("方法调用失败,反射调用异常", e);
|
||||
throw new ServiceException(EventExceptionEnum.ERROR_INVOKE);
|
||||
if (parameterClassType != null) {
|
||||
if (parameterClassType.equals(businessObject.getClass())
|
||||
|| parameterClassType.isAssignableFrom(businessObject.getClass())) {
|
||||
try {
|
||||
listenerMethod.invoke(bean, businessObject);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
log.error("方法调用失败,反射调用异常", e);
|
||||
throw new ServiceException(EventExceptionEnum.ERROR_INVOKE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue