当前位置:网站首页>Proceedingjoinpoint API use
Proceedingjoinpoint API use
2022-07-06 14:21:00 【Code siege lion】
@Around("myPointcut()")
public Integer AroundSave(ProceedingJoinPoint joinPoint) throws Throwable {
/*1、 Get the parameters of the target method :save(new User()), here user Object can get */
Object[] args = joinPoint.getArgs();
System.out.println(" This is a joinPoint Of Api Start --------------------");
System.out.println(" Print target method parameter list args ="+ Arrays.toString(args));
/*2、 You can get the reflection object of the target method Method*/
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
Method method = methodSignature.getMethod();
System.out.println(" Get the object name of the target method :"+method);
/*2.1、 from method Reflection objects get basic information */
Class<?> declaringClass = method.getDeclaringClass();
String className = declaringClass.getName();
System.out.println(" Get the name of the class "+className);
System.out.println(" Surround notification begins ");
Integer result= (Integer) joinPoint.proceed();
System.out.println(" End of surround notification ");
return result;
}
边栏推荐
猜你喜欢
随机推荐
Intranet information collection of Intranet penetration (2)
[three paradigms of database] you can understand it at a glance
《英特尔 oneAPI—打开异构新纪元》
Intranet information collection of Intranet penetration (4)
【数据库 三大范式】一看就懂
SRC mining ideas and methods
7-6 local minimum of matrix (PTA program design)
强化学习基础记录
HackMyvm靶机系列(3)-visions
Canvas foundation 1 - draw a straight line (easy to understand)
实验六 继承和多态
Intel oneapi - opening a new era of heterogeneity
Force deduction 152 question multiplier maximum subarray
Intranet information collection of Intranet penetration (5)
Canvas foundation 2 - arc - draw arc
msf生成payload大全
网络基础之路由详解
外网打点(信息收集)
Data mining - a discussion on sample imbalance in classification problems
Experiment 8 exception handling