|
[aop]
CGLIB proxies are doing AspectWerkz
[
jonas
]
The ideaAfter implementing the AW Proxy extension to AspectWerkz I figured, why not hook into the most widely used proxy implementation out there: cglib and let AspectWerkz weave in the aspects that are around just before the proxy is returned to the user. The solutionSo, this is all that this cglib extension does: asks AspectWerkz if it has anything to say about the class that has just been proxied. If so, then let the AspectWerkz weaver do its job, e.g. weave in the aspects that are currently deployed (on the classpath), and when returns the proxy to the user. If no AspectWerkz aspects are found that has pointcuts that matches the class being proxied then nothing happens. All that was needed to make this work was to add 30 lines of code to one single cglib class. How do I use it?
This means that all you need to do to make any cglib based applications, and there are many: Geronimo, dynaop, Spring AOP, Hibernate etc., become "aspectwerkz-aware" is to replace one single class in the Or.
If you can't or don't want to patch the What is the impact on my existing code?If no AspectWerkz aspects are found that has pointcuts that matches the class being proxied then nothing happens. And if AspectWerkz is not available then the whole process is skipped. So basically, there is nothing to loose, it is pay as you go (or should I rather say: gain as you go ;-) ). How do I get it?The single file you need can be found in the AspectWerkz RC2 distribution, which you can find here.
The cglib extension is in the
In the Enjoy. TrackBackPost a comment
|