Announcement Announcement Module
Collapse
No announcement yet.
changing pointcut behaviour dynamically Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • changing pointcut behaviour dynamically

    Hi folks ,
    I have a pointcut defined as mentioned below . I will like to know if in anyway i can dynamically at application runtime change the associated patterns like adding a new pattern to the existing set....or removing .

    <bean id="methodPointcut" class="org.springframework.aop.support.JdkRegexpMe thodPointcut" >
    <property name="patterns">
    <list>
    <value>com.blah.entity.*</value>
    <value>com.blah.spring.*</value>
    </list>
    </property>

    </bean>

    I will like to add another value like <value>com.blah.service.*</value> to the patterns list . How do i do that ?

    Thanks in advance !

  • #2
    What are your requirements? Are you using Auto-Proxy Creation?

    Comment


    • #3
      Yes I am using autoproxy as shown below .
      <bean class="org.springframework.aop.framework.autoproxy .DefaultAdvisorAutoProxyCreator"/>

      Comment


      • #4
        My requirement is something like as i mentioned in the first post . I do have a set of packages on which i have defined pointcut. now at runtime based on some rules i want to change the scope of the pointcut and add another package to the list

        before

        <bean id="methodPointcut" class="org.springframework.aop.support.JdkRegexpMe thodPointcut" >
        <property name="patterns">
        <list>
        <value>com.blah.entity.*</value>
        <value>com.blah.spring.*</value>
        </list>
        </property>

        </bean>

        after

        <bean id="methodPointcut" class="org.springframework.aop.support.JdkRegexpMe thodPointcut" >
        <property name="patterns">
        <list>
        <value>com.blah.entity.*</value>
        <value>com.blah.spring.*</value>
        <value>com.blah.service.*</value>
        </list>
        </property>

        </bean>

        I do not want to reload the context xml (not sure if that can be done or not )

        Comment

        Working...
        X