In AspectJ we have two concepts:
- Target object
- AOP proxy
I instantiated a target object and then passed it to the proxy factory and advised it. In order to get the new advised object, I must call proxyFactory.getProxy()
.
My target object is an Spring bean which other beans use. Once it is advised by proxyFactory how do I replace the target object with the AOP proxy everywhere it is used? I'm using Spring context.
I think AspectJ does something similar, because you just add some XML tags that contain "aop" and then your beans contain the new advised methods.