根据我的研究,我知道有两种使用 AspectJ 的方法。首先是创建 A.aj
类,其次是在 A.java
中添加注释 @Aspect
。
我正在为第二种寻找一个很好的教程,尤其是像
这样的行@After("call(void fooMethod())")
@Around("call(void sendAndReceive())")
@Before("execution(String greeting(..)) && args(context)")
但是不知道怎么称呼。
你能推荐一些教程吗?
最佳答案
这种风格被称为@AspectJ 以强调注解的作用。看看official docs和 @AspectJ cheat sheet .
关于java - AspectJ:两种教程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11761386/