Location of the proxy class created by Spring AOP

Just to learn and understand proxies, I wanted to see a proxy class created by Spring AOP. It was not present in the classes folder created by Eclipse.

Can someone tell me your location?

0
source share
1 answer

If you use an interface-based proxy (default), Spring uses the Proxy class to create proxies dynamically and in memory. There is no .class file associated with this class.

When using proxy classes (via ), Spring creates specific subclasses of your classes. In the debugger, you will notice that they are called something like YourRealService$$EnhancerByCGLIB$$... But again, these classes are only generated in memory and are not stored on disk.

If you really want to see AOP under the hood, you will need to use aspectj and compile time. Too much work. So bottom line: just trust, they work. And if they do not: examine the stack traces.

+4
source

Source: https://habr.com/ru/post/920775/


All Articles