Skip to content
Advertisement

Adding aspectJ language to define joinpoints

I’d like to define aspectj joinpoints not using annotations and string constants like this:

@Before("execution(* my.class.getText(..))")

but using aspecj language, like in this example:

pointcut myMethod(): myClass() && execution(* *(..));

or

before (): getText() {
    Trace.traceEntry("" + thisJoinPointStaticPart.getSignature());
}

Is there any good examples of how to add aspectj to the project to make maven compile this language properly and how to re-write @Before, @Around etc. annotations in aspecj language?

Advertisement

Answer

Here are some resources:

Here on Stack Overflow, I have also answered many questions about how to configure AspectJ Maven Plugin, e.g. here.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement