java - AspectJ 不适用于实现 AsyncUncaughtExceptionHandler 的类
问题描述
我有以下课程:
@Component
public class AsyncExceptionHandler implements AsyncUncaughtExceptionHandler {
@Override
public void handleUncaughtException(Throwable ex, Method method, Object... params) {
System.out.println("Error handling!");
}
}
我有以下方面:
@Before("execution(* org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler.handleUncaughtException(java.lang.Throwable, java.lang.reflect.Method, java.lang.Object...)) && "
+ "args(ex, method, params) && target(myapplication.exception.handler.AsyncExceptionHandler)")
public void asyncExceptionHandlerHandleUncaughtExceptionBefore(Throwable ex, Method method, Object... params) {
System.out.println("Aspect OK!");
}
由于登录我的应用程序的标准方式,我需要这个方面。今天,这类方面有很多方面正在发挥作用!只有这方面是行不通的!
问题:
- 我想不可能拦截 AsyncUncaughtExceptionHandler 实现(拦截器)。就是它?
- 与 varags 相关的东西
params
?
解决方案
推荐阅读
- javascript - 从特定网页获取 var 值
- php - 尝试更新数据库表内容值
- javascript - reactjs中弹出新消息时如何将div滚动到底部零
- asp.net-mvc - 在创建表单中显示 ViewModel 时出现问题
- java - Jaxb2Marshaller Mock Bean 以空 JUNIT5 形式出现
- php - 如何在 PHP 中创建和显示图像
- sonata-admin - Sonata over REST 服务
- amazon-ses - 如何使用 SES “从”客户的电子邮件发送电子邮件
- go - 带有交互式提示的 golang 简单服务器
- postgresql - 如何将 Postgres CLI 中的转储数据库从远程服务器传输到远程服务器或本地计算机?