|
From: Dmitriy K. <dko...@ru...> - 2004-05-12 01:57:11
|
I'm just trying to understand what is the purpose of my.spring.AutowireByInterface class? Why not just use 'autowire="byType"' attribute of beans needing SecuritySAO dependency? Regards, Dmitriy. James Cook wrote: >I'm experiencing a problem with the order that my beans are wired together. >I have an SAO bean (id=SecuritySAO) and it is a singleton. > >I want this bean to be advised by a BeanNameAutoProxyCreator so it will be >control transactions. > >I also want this bean to be wired into another BeanPostProcessor class I >wrote called SAOAware. > >The problem is that the SecuritySAO bean is created initially be the >SAOAware bean because it is a property of the latter. This means that the >AutoProxy bean has not yet had an opportunity to work its magic on the bean >and proxy it. > >When I use the SAOAware bean, the SecuritySAO object is not proxied and not >weaved into the transation interceptor. I have tried to use the depends-on >to cause the AutoProxy to instrument the bean first, but it didn't make any >difference. I have also used the ordered property of both post processors >without any effect also. > >Am I missing something else? > > ><bean id="SecuritySAO" class="my.SecuritySAOImpl" /> > > ><bean id="AutoProxy" >class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator" > > > <property name="proxyTargetClass"><value>true</value></property> > <property name="order"><value>1</value></property> > <property name="interceptorNames"> > <list> > <idref local="transactionInterceptor"/> > </list> > </property> > <property name="beanNames"> > <list> > <idref local="jpp.SecuritySAO"/> > </list> > </property> ></bean> > ><bean id="SAOAware" class="my.spring.AutowireByInterface" >depends-on="AutoProxy"> > <property name="order"><value>100</value></property> > <property name="interface"><value>my.SAOAware</value></property> > <property name="property"><value>securitySAO</value></property> > <property name="value"><ref bean="SecuritySAO" /></property> ></bean> > > > > >------------------------------------------------------- >This SF.Net email is sponsored by Sleepycat Software >Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to >deliver higher performing products faster, at low TCO. >http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |