Announcement Announcement Module
Collapse
No announcement yet.
Is it got any way that can apply multiple advice to NameMatchMethodPointcutAdvisor ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it got any way that can apply multiple advice to NameMatchMethodPointcutAdvisor ?

    hi, i just wondering if that any way to apply multiple advice to particular method name ?

    The NameMatchMethodPointcutAdvisor.setAdvice(Advice advice) properties show that it only accept one advice, is that any class that can use to insert multiple advice (in xml instead of using java code) like addAdvice(Advice[] advice) ?

    thx for help
    Last edited by kiwi; Sep 1st, 2006, 12:57 AM.

  • #2
    An alternative

    You can get the same effect by adding multiple advice/advisors to the associated proxy factory.

    -Ramnivas

    Comment


    • #3
      hi, is that a possible way to insert in the advisor itself instead in proxy factory ?

      so i can get like this :

      <bean id = "advisorPointCut" class = "org.springframework.aop.support.NameMatchMethodPo intcutAdvisor">
      <property name = "mappedNames">
      <list>
      <value>method1</value>
      <value>method2</value>
      </list>
      </property>
      <!-- wrong one, will get runtime error -->
      <property name = "advice" >
      <List>
      <ref bean = "Advice1">
      <ref bean = "Advice2"/>
      </List>
      <!-- end wrong -->
      </property>
      </bean>

      so that i only insert one interceptornames

      ...
      <property name = "interceptorNames">
      <list>
      <value>advisorPointCut</value>
      </list>
      ...

      and can eliminates the duplication of xml code of the advisorPointcut (like make 2 advisor that only advice is diff and put in proxy).

      Comment

      Working...
      X