Results 1 to 2 of 2

Thread: Aspects instances scheme-based

  1. #1
    Join Date
    Mar 2010
    Posts
    2

    Default Aspects instances scheme-based

    Hi, Spring expert
    I'm working with scheme-based AOP support, and i canīt have more one
    instance of aspect (bean) when intercepts the same event but of diferent domains beans. I need save a state in the aspects, then i need more one instance. Can i do this with scheme-bases support?? how???
    Sorry for my english.
    Thanks and bye

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    Spring uses a proxy based aop approach and therefor needs instances. So basically what you want isn't available with this approach, if you want more you want to revert to full blown aspectj and loadtime and/or compile time weaving.

    As a workaround you could store the state in a ThreadLocal instead of the instance of the Aspect.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

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