Announcement Announcement Module
Collapse
No announcement yet.
general proxy/interceptor questions... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment

    Working...
    X