Announcement Announcement Module
Collapse
No announcement yet.
BeanNameAutoProxyCreator question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • BeanNameAutoProxyCreator question

    I have the following code in my clientContext.xml to set up a BeanNameAutoProxyCreator object to call a MethodInterceptor for *Proxy beans, all of which are SimpleRemoteStatelessSessionProxyFactoryBeans:

    Code:
    	<bean id="securityInterceptor" class="test.service.SecurityInterceptor"/>
    	
    	<bean id="securityProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> 
    		<property name="beanNames">
    			<list>
    				<value>*Proxy</value>
    			</list>
    		</property>
    		<property name="interceptorNames">
    			<value>securityInterceptor</value>
    		</property>
    	</bean>
    My issue - the isMatch() method of BeanNameAutoProxyCreator is not being called for any of my Proxy objects in the XML file, but it is being called for some of the other defined beans. What am I doing wrong? Do they need to be implementing a specific interface to be picked up by the AutoProxy?

  • #2
    all of which are SimpleRemoteStatelessSessionProxyFactoryBean
    Take a look at http://forum.springframework.org/showthread.php?t=10321.

    not being called for any of my Proxy objects in the XML file, but it is being called for some of the other defined beans
    Can you post the bean definition which is being proxied - this looks like a separate problem.

    Do they need to be implementing a specific interface to be picked up by the AutoProxy?
    No.
    Last edited by robyn; May 16th, 2006, 05:37 AM.

    Comment


    • #3
      Thanks for the response. I have already seen the thread you mentioned and it does work that way, but is not a very nice solution IMO.

      Here is what my bean looks like:

      Code:
      	<bean id="articleProxy" name="articleProxy"
      		class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
      		<property name="lookupHomeOnStartup">
      			<value>false</value>
      		</property>
      		<property name="jndiName">
      			<value>com.test.ArticleServiceHome</value>
      		</property>
      		<property name="businessInterface">
      			<value>com.test.proxy.ArticleServiceProxyI</value>
      		</property>
      		<property name="jndiTemplate">
      			<ref bean="jndiTemplate" />
      		</property>
      	</bean>

      Comment

      Working...
      X