Results 1 to 2 of 2

Thread: Aspects not firing when method invoked from within same class

  1. #1

    Default Aspects not firing when method invoked from within same class

    I know that Spring AOP uses some kind of proxy class for its aspect implementation. The problem I'am having, is that my pointcuts are not working when I call the method that is adviced from within the same class.

    Is this something I have to live with? Lets say I have a class Me that contains the method A and B. When I call Me.A() from an external class the aspect is being used but not if I call Me.B() which then calls itself this.A(). Does that mean, a private method cannot be used in a pointcut?

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

    Default

    Yes and No...

    If you would use full AspectJ pointcuts and full aspectJ you could do this. However with the Spring AOP implementation you cannot.
    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
  •