我不明白为什么在这种情况下@After
应用建议而不是:@AfterThrowing
@Pointcut("execution(* componentB.Bye.run())")
public void newThread(){
}
@After("newThread()")
public void cokolwiek2(JoinPoint joinPoint){
report(joinPoint);
}
@AfterThrowing(pointcut="newThread()",throwing="e")
public void itsAFoo(JoinPoint joinPoint, RemoteException e) {
logger.error(joinPoint.getSignature().toLongString() + " exception here!");
}
我确信会引发异常:
public String greeting(String c) throws RemoteException,
InterruptedException {
throw new RemoteException();
//return "Good morning!";
}
但是没有日志exception here!