Announcement Announcement Module
Collapse
No announcement yet.
How to setup pointcut for methods on common interface? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to setup pointcut for methods on common interface?

    Hello,

    I have many classes implementing a common interface, e.g.

    interface MyInterface {

    void foo();
    void bar();
    }

    And I want to inject profiling code around these methods to profile all their implementation in all those classes without modifying those code (some of them are not written by me). How to do this in Spring AOP and/or Aspect J?

    Thx
    Chuck

  • #2
    Hi Chuck,
    take look into this document and you will find all your answers you are searching for: http://static.springsource.org/sprin.../html/aop.html

    Mainly take a look in sections 7.2.3.2, which give a slight introduction and later in the document dive deeper into materia.

    Comment


    • #3
      you can do in this manner, execution(* ..Sample+.sampleGenericMethod(*)

      or


      target(com.xyz.service.AccountService)

      Comment

      Working...
      X