Aspect Pointcut 多路径配置
程序员文章站
2022-06-01 10:29:34
...
配置如下:
@Pointcut("execution(* com.zit.itmp.monitorinfo.service.*.save*(..))"
+ "||execution(* com.zit.itmp.monitorinfo.service.*.delete*(..))"
+ "||execution(* com.zit.itmp.monitorinfo.service.*.update*(..))")
public void addUpdateDelServiceCall() {
}
Aspect完整配置,如下:
@Aspect
@Component
public class UpdateMonitorInfoCacheAspect {
@Pointcut("execution(* com.zit.itmp.monitorinfo.service.*.save*(..))"
+ "||execution(* com.zit.itmp.monitorinfo.service.*.delete*(..))"
+ "||execution(* com.zit.itmp.monitorinfo.service.*.update*(..))")
public void addUpdateDelServiceCall() {
}
@AfterReturning(value="addUpdateDelServiceCall()", argNames="rtv", returning="rtv")
public void insertServiceCallCalls(JoinPoint joinPoint, Object rtv) throws Throwable{
new Thread(()->{
MonitorInfoCache.INSTANCE.loadRefresh();
}).start();
}
}