0
votes

I am using Spring AOP with aspectj-autoproxy. I use the @Around annotation to intercept certain classes and methods.

@Around(value = "@annotation(counter)")

This code should intercept methods annotated with @Counter annotation.

My question is, does this definition forces scan of all classes in the class path? I am asking because I have a huge project that can suffer several minutes of loading time if all the class path will be scanned.

And if the answer is yes, how can I disable he scanning?

2

2 Answers

0
votes

It will only scan the defined Spring beans, thus not the complete class path.. In addition the annotation @Counter should be specified as the Fully-Qualified Class Name and I don't think "counter" is the correct one..

0
votes

Limit the scan using:

execution(* com.my.package..*.*(..)) && @annotation(counter)