|
From: Chris N. <ch...@si...> - 2004-10-06 00:53:18
|
Rod Johnson wrote: > Your analysis looked right to me. Unfortunate. There are certainly quite > a few negative consequences of the CGLIB subclassing approach. It would > be good if there were other options we could consider when proxying > classes (the AopProxyFactory interface gives us a choice), but I'm not > aware of anything that's equally convenient. I've posted a comment on how to work around this "feature" of CGLIB (it is a feature, really :-) If you want to proxy concrete classes your options are pretty limited, I think. One possibility you may not be aware of is that if you are proxying JavaBeans you could use net.sf.cglib.beans.BeanGenerator to generate a bean that has the same properties as your target bean. Then use the Enhancer to proxy the generated bean, dispatching to the target as appropriate. This way you avoid all issues with the superclass constructor being invoked, since the generated bean extends Object. Let me know if you want to explore this further. Chris |