Announcement Announcement Module
No announcement yet.
how to avoid specific classes in beanNames Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to avoid specific classes in beanNames

    I have an interceptor and I want to apply it to all beans except a certain class. How do i achieve this.

    for all beans i use this
    <property name="beanNames"><value>*</value></property>

    for selected classes I use this
    <property name="beanNames"><value>*Controller,Hib*,*Intf</value></property>

    but now sure how to define one for all classes except say (*Intf)

    Thanks in advance.

  • #2
    I don't think you have a way to exclude a certain pattern from matching.
    I'd take a look at the source code for the proxy creator class you are using and extend it in a way to add something like: excludedNames property.

    Another solution would be to use an AspectJ pointcut: execution(* my.package.*(..) && !execution(* not.interceptable.package.*(..))


    • #3
      Thanks for your response. I will take a look at the options.


      • #4
        You could also introduce an annotation that will tag the method/class as excludable from your specific pointcut definition.