Results 1 to 3 of 3

Thread: Spring AOP Pointcut with internal method call.

  1. #1

    Default Spring AOP Pointcut with internal method call.

    Hello,

    I have defined the following pointcut:

    <aop:config>
    <aopointcut id="relationshipGetRelatedPeoplePointCut"
    expression="execution(* uk.co.bbc.opensocial.core.service.RelationshipServ ice.getRelatedPeople(..))" />
    <aop:advisor advice-ref="relationshipMemCacheInterceptor"
    pointcut-ref="relationshipGetRelatedPeoplePointCut" />
    </aop:config>

    This works fine for methods called outside the actual class but when i call:

    this.getRelatedPeople from inside the RelationshipService class the pointcut is not executed. This class is initialized in Spring so i expected everything to work properly.

    Any ideas?

    Thanks in advance.

    Mark.

  2. #2
    Join Date
    Nov 2007
    Posts
    420

    Default

    Spring AOP is proxy based, can't advice on internal method calls, call has to be done on proxy for AOP to work. It's all in the documentation....

  3. #3
    Join Date
    May 2007
    Location
    Saint Petersburg, Russian Federation
    Posts
    1,189

    Default

    Quote Originally Posted by markyjames81 View Post
    ...
    This works fine for methods called outside the actual class but when i call:

    this.getRelatedPeople from inside the RelationshipService class the pointcut is not executed. This class is initialized in Spring so i expected everything to work properly.

    Any ideas?

    Thanks in advance.

    Mark.
    That is explained in details here

Posting Permissions

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