|
From: Rod J. <rod...@in...> - 2003-12-12 09:13:19
|
+1. Proxying interfaces only is normally good practice, which means that people should only need to choose to use CGLIB for AOP if they're "power users". Regards, Rod ----- Original Message -----=20 From: "j=FCrgen h=F6ller [werk3AT]" <jue...@we...> To: <spr...@li...> Sent: Friday, December 12, 2003 9:01 AM Subject: RE: [Springframework-developer] RE: About CGLIB2 I'd like to keep sticking to the inner-class strategy for AdvisedSupport:= It removes a CGLIB dependency for people that just want to proxy interfaces anyway. For that use case, no version of CGLIB should have to be in the class path - spring, commons-logging, and aop-alliance should be enough. = The actual AopProxy implementations for CGLIB can still use any CGLIB feature that they want. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Colin Sampaleanu Sent: Thursday, December 11, 2003 7:42 PM To: spr...@li... Subject: Re: [Springframework-developer] RE: About CGLIB2 This works fine now without the cglib1 jar. I agree with using the inner-class strategy for a while. We should probably limit the period of time we do this though; there are a lot of useful features in cglib2, and it doesn't make sense to ignore them or have to jump through hoops to use them, for too long a period of time, considering the only real beneficiaries will be Hibernate 2.0 users, who are going to be a rapidly dying breed. Regards, j=FCrgen h=F6ller [werk3AT] wrote: >I've just fixed it by re-introducing an inner class CglibProxyFactory: G= rab the current AdvisedSupport from CVS, and a JDK proxy will work with Hibernate 2.1 - without the need for cglib1.jar in the class path. I've tested it with Petclinic, and it works nicely. > >We should stick to that inner-class strategy when migrating to CGLIB2, t= o let people use Hibernate 2.0.x or iBATIS Database Layer (with CGLIB1 underneath). > >Juergen > > >-----Original Message----- >From: spr...@li... >[mailto:spr...@li...]On Behalf >Of Rod Johnson >Sent: Thursday, December 11, 2003 6:42 PM >To: spr...@li... >Subject: Re: [Springframework-developer] RE: About CGLIB2 > > >I guess in my refactoring I lost the indirection by which a CGLIB proxy = was >created only by an inner class, to prevent dependence on CGLIB at runtim= e. >I'll try to sort that out tomorrow or Monday. > >Btw, the TransactionProxyFactoryBean now extends the new ProxyConfig, wh= ich >has a proxyTargetClass property that defaults to false. Set it to true t= o >force CGLIB. Otherwise it won't use CGLIB by default. > >Regards, >Rod > >----- Original Message -----=20 >From: "Colin Sampaleanu" <col...@ex...> >To: <spr...@li...> >Sent: Thursday, December 11, 2003 5:29 PM >Subject: Re: [Springframework-developer] RE: About CGLIB2 > > > > >>j=FCrgen h=F6ller [werk3AT] wrote: >> >> >> >>>Everybody, >>> >>>Hibernate 2.1 final with CGLIB2 underneath has just been released. Thi= s >>> >>> >poses the question whether we should still release our 1.0 M4 with CGLIB= 1 >support. Of course, our current codebase works nicely with Hibernate 2.1= as >long as you don't use CGLIB-based AOP proxies (i.e. proxy full target >objects instead of just interfaces), so we don't *have* to update >immediately. > > >>> >>> >>> >>Hmm, maybe this was once the case, but I am not sure it is so easy any >>longer. I tried dropping in Hibernate 2.1 final (with cglib2). However, >>when using TransactionProxyFactoryBean, which no longer has the old >>ProxyInterfacesOnly boolean option (which used to default to true, and >>used a JDK proxy in the true case instead of cglib proxy), I now get an >>exception >> >>java.lang.NoClassDefFoundError: >>org/springframework/aop/framework/OptimizedCglib1AopProxy >> at >> >> >> >org.springframework.transaction.interceptor.TransactionProxyFactoryBean.= aft e >rPropertiesSet(TransactionProxyFactoryBean.java:167) > > >> at >> >> >> >org.springframework.beans.factory.support.AbstractBeanFactory.callLifecy= cle M >ethodsIfNecessary(AbstractBeanFactory.java:1011) > > >> at >> >> >> >org.springframework.beans.factory.support.AbstractBeanFactory.createBean= (Ab s >tractBeanFactory.java:539) > > >> at >> >> >> >org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab= str a >ctBeanFactory.java:186) > > >> at >> >> >> >org.springframework.beans.factory.support.DefaultListableBeanFactory.pre= Ins t >antiateSingletons(DefaultListableBeanFactory.java:184) > > >> at >> >> >> >org.springframework.context.support.AbstractApplicationContext.refresh(A= bst r >actApplicationContext.java:284) > > >> at >> >> >> >org.springframework.web.context.support.XmlWebApplicationContext.refresh= (Xm l >WebApplicationContext.java:107) > > >>The offending line is: >> >> ProxyFactory proxyFactory =3D new ProxyFactory(); >> >>Of course, ProxyFactory extends AdvisedSupport, which directly >>references OptimizedCglib1AopProxy. >> >> ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dclick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |