1

如何以只有一个代理的方式混合 BeanNameAutoProxyCreator 和 (Transaction)ProxyFactoryBean?我想用 JamonInterceptor 创建一个代理,但有些还定义了一个事务拦截器/工厂 bean,这些在 Jamon 中显示为 $ProxyXYZ。

我使用弹簧 2.5.6

4

1 回答 1

1

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.

于 2009-06-23T18:39:20.737 回答