Announcement Announcement Module
Collapse
No announcement yet.
spring aop and session scoped beans Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring aop and session scoped beans

    Hello

    I have problem with aop and proxy scoped beans.

    Let say I have bean:

    <bean id="ct" class="mypackage.ContentBeanImpl" parent="abstractBean" scope="session">
    <aop:scoped-proxy/>
    </bean>

    <bean id="abstractBean" class="mypackage.AbstractBean" scope="prototype" init-method="init">
    <property name="beanLocator" ref="beanLocator" />
    <property name="serviceLocator" ref="serviceLocator" />
    </bean>

    id like to do something when method save are called from ct

    <bean id="debugInterceptor" class="org.springframework.aop.interceptor.DebugIn terceptor">
    <property name="useDynamicLogger" value="true"/>
    </bean>

    <bean id="ctProxy" class="org.springframework.aop.framework.ProxyFact oryBean">
    <property name="singleton" value="false"/>
    <property name="proxyTargetClass">
    <value>true</value>
    </property>
    <property name="proxyInterfaces">
    <value>mypackage.ContentBean</value>
    </property>
    <property name="target">
    <ref local="ct" />
    </property>
    <property name="interceptorNames">
    <list>
    <value>debugInterceptor</value>
    </list>
    </property>
    </bean>

    but no luck, I don't see any effect on console

  • #2
    Use [ code][/code ] tags when posting code.

    You need to call the methods on the proxy NOT on the ct object.

    Comment

    Working...
    X