Announcement Announcement Module
No announcement yet.
template for interceptor stack? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • template for interceptor stack?


    is there a way to defne some form of template for an interceptor stack?

    I have a lot of services defined in a spring application context that should all be intercepted by a stack of the same interceptors. Instead of defining a ProxyFactoryBean with a list of the same interceptors *for every* service, I like to define this interceptor-list only once and wire it with the least possible amount of typing in the application context xml file.

    Thanks for any hints that could help me!


  • #2
    template for interceptor stack?

    Hi Felix,

    I am also interested in that approach. If you read my recent posting ( you'll see that I tried to create a parent "EnterpriseBeanTemplate" to apply a series of interceptors to several POJOs.

    Unfortunately Spring throws an Exception during application context initialization.

    Another approach I am trying is to use BeanNameAutoProxyCreator to apply interceptor stacks to several beans identified by name (with wildcards). Several interceptors/advisors use source code annotations to figure out the pointcut. So far this approach is working nicely.

    Best regards,
    Last edited by robyn; May 19th, 2006, 05:53 AM.


    • #3
      Thanks Fernando, the <bean ... abstract="true"> and <bean ... parent="..."> stuff was basically what I was looking for.



      • #4
        Just to complete this topic: there are also the 'autoproxying' facilities of Spring described in chapter 5.10 of the Spring reference manual. Autoproxying is probably a bit more comfortable (i.e. there's no need to have the target bean with a different name), but it also includes the disadvantage of beeing a bit more "automagic" by not explicitly expressing what is happening (IMHO one of the big dangers with AOP anyway).