Jul 19th, 2007, 09:39 AM
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
for selected classes I use this
but now sure how to define one for all classes except say (*Intf)
Thanks in advance.
Jul 19th, 2007, 10:34 AM
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
Thanks for your response. I will take a look at the options.
Jul 19th, 2007, 02:05 PM
You could also introduce an annotation that will tag the method/class as excludable from your specific pointcut definition.