Announcement Announcement Module
Collapse
No announcement yet.
@Around annotation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Around annotation

    Hi all,
    We are having a slight issue getting the @AspectJ annotations to work on an around advice.

    We have done a search, but fail to find any explantion of the annotation syntax, so were hoping you guys would help.

    We have a class A.
    A has several methods all of which we wish to put @Around advice on, so that we can change the exception that is being thrown.

    Here is an example of the @AspectJ class we are using:

    Code:
    .....
    @Around("Execution(* com.myclasses..*Dao(..))"
    public Object aMethod(ProceedingJoinPoint pjp){
    }
    We are happy with the actual advice, but we dont understand the syntax of the annotation:

    What does the first * represent, is it the return type?
    Is the .*Dao acceptable?
    what is the meaning of the (..)?

    Thanks
    G

  • #2
    You should read Spring and AspectJ reference guide.

    In your case:
    - The first * means any return type.
    - The first .. means any level of packages (i.e. direct and indirect subpackages of com.myclasses)
    - The last .. means any number and type of arguments.

    -Ramnivas

    Comment


    • #3
      Thanks for the that.

      Gavin

      Comment

      Working...
      X