|
From: <jue...@we...> - 2003-12-12 09:02:26
|
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=20 probably limit the period of time we do this though; there are a lot of=20 useful features in cglib2, and it doesn't make sense to ignore them or=20 have to jump through hoops to use them, for too long a period of time,=20 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: = Grab 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, = to 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 = runtime. >I'll try to sort that out tomorrow or Monday. > >Btw, the TransactionProxyFactoryBean now extends the new ProxyConfig, = which >has a proxyTargetClass property that defaults to false. Set it to true = to >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 > > > =20 > >>j=FCrgen h=F6ller [werk3AT] wrote: >> >> =20 >> >>>Everybody, >>> >>>Hibernate 2.1 final with CGLIB2 underneath has just been released. = This >>> =20 >>> >poses the question whether we should still release our 1.0 M4 with = CGLIB1 >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. > =20 > >>> >>> =20 >>> >>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 >> >> =20 >> >org.springframework.transaction.interceptor.TransactionProxyFactoryBean.= afte >rPropertiesSet(TransactionProxyFactoryBean.java:167) > =20 > >> at >> >> =20 >> >org.springframework.beans.factory.support.AbstractBeanFactory.callLifecy= cleM >ethodsIfNecessary(AbstractBeanFactory.java:1011) > =20 > >> at >> >> =20 >> >org.springframework.beans.factory.support.AbstractBeanFactory.createBean= (Abs >tractBeanFactory.java:539) > =20 > >> at >> >> =20 >> >org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab= stra >ctBeanFactory.java:186) > =20 > >> at >> >> =20 >> >org.springframework.beans.factory.support.DefaultListableBeanFactory.pre= Inst >antiateSingletons(DefaultListableBeanFactory.java:184) > =20 > >> at >> >> =20 >> >org.springframework.context.support.AbstractApplicationContext.refresh(A= bstr >actApplicationContext.java:284) > =20 > >> at >> >> =20 >> >org.springframework.web.context.support.XmlWebApplicationContext.refresh= (Xml >WebApplicationContext.java:107) > =20 > >>The offending line is: >> >> ProxyFactory proxyFactory =3D new ProxyFactory(); >> >>Of course, ProxyFactory extends AdvisedSupport, which directly >>references OptimizedCglib1AopProxy. >> =20 >> ------------------------------------------------------- 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 |