-
Jul 19th, 2007, 09:39 AM
#1
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.
-
Jul 19th, 2007, 10:34 AM
#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.*(..))
-
Jul 19th, 2007, 10:44 AM
#3
Thanks for your response. I will take a look at the options.
-
Jul 19th, 2007, 02:05 PM
#4
You could also introduce an annotation that will tag the method/class as excludable from your specific pointcut definition.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules