I am familiar with Spring AOP . Since I read in the spring documentation http://docs.spring.io/spring/docs/3.1.x/spring-framework-reference/html/aop.html , Spring AOP working on a proxy concept.
In section 8.2.3.1 Supported pointcut pointers , I found the following note
Due to the foundation based on the spring AOP proxy structure, the secure methods by definition are not intercepted, neither for the JDK proxy (if not applicable), nor for the CGLIB proxy (where it is technically possible, but not recommended for AOP purposes). As a result, any given pointcut will be matched with public methods only!
At first I did not believe, so I tried to implement it without using interfaces, where all methods are publicly accessible by default, and was surprised that this is true. Since proxy classes are subclasses of the recommended / target object, and protected methods can be accessed by a subclass, so I thought that protected methods would work fine.
Can someone please let me know why protected methods are not intercepted? Did I miss something?
source share