<dependency> <groupId>com.nepxion</groupId> <artifactId>matrix-aop-starter</artifactId> <version>x.x.x</version> </dependency> <aop:config> <aop:aspect ref="myAspect"> <aop:pointcut id="myPointcut" expression="execution(* com.example.MyClass.*(..))" /> <aop:around method="aroundAdvice" pointcut-ref="myPointcut" /> </aop:aspect> </aop:config> <bean id="myAspect" class="com.example.MyAspect" /> public class MyAspect { public Object aroundAdvice(ProceedingJoinPoint joinPoint) throws Throwable { System.out.println("Before method execution"); Object result = joinPoint.proceed(); System.out.println("After method execution"); return result; } }


上一篇:
下一篇:
切换中文