Results 1 to 4 of 4

Thread: BeanNameAutoProxyCreator Regexp to define beanNames patterns

  1. #1
    Join Date
    Aug 2005
    Location
    Paris / London
    Posts
    6

    Default BeanNameAutoProxyCreator Regexp to define beanNames patterns

    Hi,

    I would like to use regexp to define bean names (i.e
    Code:
    *myBean*DAO
    or
    Code:
    *myBean*Service
    ) in BeanNameAutoProxyCreator, but it does not work, the only pattern accepted is
    Code:
    myBean*
    .

    Code:
    <beans>
    	<bean id="my-debugInterceptor" 					class="org.springframework.aop.interceptor.DebugInterceptor"/>
    	<bean id="my-traceInterceptor" 					class="org.springframework.aop.interceptor.TraceInterceptor"/>
    	<bean id="my-performanceMonitorInterceptor" 		class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor"/>
    	<bean id="my-jamonPerformanceMonitorInterceptor" 	class="org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor"/>
    
    
    <bean id="my-debugAutoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
    		<property name="interceptorNames">
    			<list>
    			   <idref bean="my-traceInterceptor"/>
    			   <idref bean="my-performanceMonitorInterceptor"/>
    			</list>
    		</property>
    		<property name="beanNames">
    			<list>
                                    <value>*myBean*DAO</value>
    				<value>*myBean*Service</value>
    			</list>
    		</property>
    	</bean>
    </beans>
    Any suggestion will be welcome , thanks in advance,

    Kinds regards,

    Steve

  2. #2
    Join Date
    Aug 2005
    Posts
    16

    Default

    Code:
    *myBean*DAO
    and
    Code:
    *myBean*Service
    aren't valid regexps. You most likely want
    Code:
    .*myBean.*Dao
    and
    Code:
    .*myBean.*Service

  3. #3
    Join Date
    Aug 2005
    Location
    Paris / London
    Posts
    6

    Default BeanNameAutoProxyCreator beanNames patterns

    Thanks for your help but it does not work, in fact it seems that usual regular expressions are not supported, may be the char '*' is just a pattern supported by BeanNameAutoProxyCreator class, this is why I wonder if another class exist in spring framework with regexp support ?

    Steve

  4. #4
    Join Date
    Aug 2005
    Posts
    16

    Default

    Oops, I wasn't paying enough attention. It seems that BeanNameAutoProxyCreator only accepts patterns that begin with * or end with * -- you can't have * in the middle somewhere. It doesn't look like there's a class with regexp support for what you want, but maybe take a look at DefaultAdvisorAutoProxyCreator.

Similar Threads

  1. Replies: 3
    Last Post: Aug 16th, 2005, 12:26 AM
  2. Design Patterns with Controllers
    By umark in forum Web
    Replies: 2
    Last Post: Jun 17th, 2005, 12:29 PM
  3. Replies: 1
    Last Post: Jan 25th, 2005, 01:24 AM
  4. Replies: 0
    Last Post: Oct 14th, 2004, 03:16 PM
  5. Get Bean Define from DataBase?
    By waspxyz in forum Container
    Replies: 3
    Last Post: Sep 15th, 2004, 08:13 AM

Posting Permissions

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