Results 1 to 2 of 2

Thread: general proxy/interceptor questions...

  1. #1
    Join Date
    Mar 2005
    Posts
    144

    Question general proxy/interceptor questions...

    If I were to define a BeanNameAutoProxyCreator like this:

    Code:
        <bean name="myServiceProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
            <property name="beanNames" value="*Service"/>
            <property name="interceptorNames">
                <list>
                    <value>performanceMonitoringInterceptor</value>       
                </list>
            </property>
        </bean>
    Does the same instance of the bean "performanceMonitoringInterceptor" get used in each proxy that gets created? Is this driven by how my performanceMonitoringInterceptor bean is configured by spring (id isSingleton=false)?

    Josh

  2. #2
    Join Date
    Mar 2007
    Posts
    515

    Default

    If your performanceMonitoringInterceptor is defined as 'prototype' then a different instance is used in each proxy that is created. BeanNameAutoProxyCreator uses getBean() method from BeanFactory to get the interceptors.

Posting Permissions

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