Results 1 to 3 of 3

Thread: How to setup pointcut for methods on common interface?

Hybrid View

  1. #1
    Join Date
    Nov 2011
    Posts
    4

    Default 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. #2

    Default

    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.

  3. #3
    Join Date
    Dec 2008
    Location
    India
    Posts
    295

    Default

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

    or


    target(com.xyz.service.AccountService)
    Enjoy
    Rohan Chauhan
    ------------------------------------------------------------------------------
    SpringSource Certified Spring 3.0 Professional


Posting Permissions

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