tags:

views:

117

answers:

1

How do I mix BeanNameAutoProxyCreator and (Transaction)ProxyFactoryBean in such a way that there is only one proxy? I want to create a proxy with JamonInterceptor, but some have also an transaction interceptor/factory bean defined and these show up as $ProxyXYZ in Jamon.

I use spring 2.5.6

+1  A: 

TransactionProxyFactoryBean is used to generate a proxy for a specific target bean, whereas BeanNameAutoProxyCreator creates proxies for multiple beans. It's up to you to make sure those don't clash.

What bean name are you using for the your transaction-proxied bean? Is that bean name being caught by the BeanNameAutoProxyCreator? If so, then the TransactionProxyFactoryBean is always going to obscure the type of the target class, there's no avoiding that.

skaffman
The BeanNameAutoProxyCreator matches *Service and *Dao. The (TransAction)ProxyFactoryBean is most of the time an *Service name with a target named *ServiceTarget.I am altering the configuration from assiging the JamonInterceptor for every bean, to assiging it using the BeanNameAutoProxyCreator
Salandur