Results 1 to 4 of 4

Thread: template for interceptor stack?

Hybrid View

  1. #1
    Join Date
    Dec 2004
    Location
    Germany
    Posts
    24

    Default template for interceptor stack?

    Hi,

    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!

    Felix

  2. #2
    Join Date
    Aug 2004
    Location
    Madrid, Spain
    Posts
    25

    Default template for interceptor stack?

    Hi Felix,

    I am also interested in that approach. If you read my recent posting (http://forum.springframework.org/showthread.php?t=12675) 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,
    Fernando
    Last edited by robyn; May 19th, 2006 at 05:53 AM.

  3. #3
    Join Date
    Dec 2004
    Location
    Germany
    Posts
    24

    Default

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

    Felix

  4. #4
    Join Date
    Dec 2004
    Location
    Germany
    Posts
    24

    Default

    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).

    Cheers,
    Felix

Similar Threads

  1. Spring-based Mail Template Framework
    By eisenb in forum Architecture
    Replies: 3
    Last Post: Dec 2nd, 2010, 07:24 AM
  2. Velocity Template Location
    By zegloman in forum Web
    Replies: 8
    Last Post: May 21st, 2010, 03:23 AM
  3. Hibernate Template or AOP Interceptor?
    By etienno in forum Data
    Replies: 1
    Last Post: Apr 15th, 2005, 02:44 AM
  4. which Template Engine
    By Gideon in forum Web
    Replies: 8
    Last Post: Nov 9th, 2004, 02:29 AM
  5. hibernate template
    By sboulay in forum Data
    Replies: 5
    Last Post: Aug 11th, 2004, 09:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •