How can I proxy an object returned by a FactoryBean? Specificly, I want to put a DebugInterceptor around a RemoteStatelessSessionProxyFactoryBean. The problem is, it puts it around the FactoryBean, not what the FactoryBean returns (the proxy to the EJB)
Here's an example:
What that produces is entries in my log of:Code:<bean id="serviceProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator" lazy-init="false"> <property name="beanNames"> <value>userService,caseService,customerService,contactService</value> </property> <property name="interceptorNames"> <list> <value>debugInterceptor</value> </list> </property> </bean> <bean id="debugInterceptor" class="org.springframework.aop.interceptor.DebugInterceptor" /> <bean id="userService" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean" lazy-init="true" singleton="true"> <property name="businessInterface"> <value>mypackage.UserService</value> </property> <property name="jndiName"> <value>UserServiceBean-v1.6.0.0</value> </property> <property name="jndiTemplate"> <ref bean="jndiTemplate"/> </property> </bean>
... which isn't very helpful.Code:Debug interceptor: count=1 invocation=[Invocation: method=[public abstract java.lang.Object org.springframework.beans.factory.FactoryBean.getObject() throws java.lang.Exception] args=null] target is of class [org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean]] Debug interceptor: next returned


Reply With Quote