AOP重用切入点表达式
发布日期:2021-05-10 02:13:32 浏览次数:19 分类:精选文章

本文共 1115 字,大约阅读时间需要 3 分钟。

������������������������������������������������������������������������������������������������������������������

������������������@Pointcut���������������������������������������������������������

public class MynewAspect { @Pointcut("execution(public * calculator.CalculatorImpl.*(..))") public void decare(){} @Before("decare()") public void before(JoinPoint joinPoint){ System.out.println("���������"+joinPoint.getSignature().getName()); }}

������������������������������������������������������������������������������������������������

public class MyAspect { @Before("calculator.MynewAspect.decare()") public void before(JoinPoint joinPoint){ System.out.println("���������"+Arrays.asList(joinPoint.getArgs())); }}

���������

  • ���������������������������������������������
  • ������������������������������@Pointcut���������������������
  • ���������������������������
  • ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@After���@Around���������������������������������������������

    上一篇:Spring+Maven+JdbcTemplate实现对mysql数据库操作
    下一篇:AOP切面的优先级Order属性

    发表评论

    最新留言

    留言是一种美德,欢迎回访!
    [***.207.175.100]2025年03月31日 13时21分06秒