Results 1 to 3 of 3

Thread: BeanNameAutoProxyCreator question

  1. #1
    Join Date
    Apr 2005
    Posts
    13

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    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 at 04:37 AM.

  3. #3
    Join Date
    Apr 2005
    Posts
    13

    Default

    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>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •