Announcement Announcement Module
Collapse
No announcement yet.
Spring AOP Pointcut with internal method call. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


    • #3
      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

      Comment

      Working...
      X