0
我已经定义了两个AfterThrowing通知来处理具有相同切入点的异常。处理特定的异常类型
@AfterThrowing(pointcut="...", throwing="ex")
public void method1(Exception ex) {}
@AfterThrowing(pointcut="...", throwing="ex")
public void method2(GatewayException ex) {}
如果异常是一个GatewayException,我有办法阻止泛型方法1被执行吗?
任何想法不胜感激
Ç
是的,我希望避免instanceof,但我认为你是对的。 – Cathal