Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: Newbie Method Call Question.



>How about just using getClass() on the value of this at the call join
>point, e.g.,
>
>before(Action caller) : call(* businessMethod()) && this(caller) {
>    logger.log("Call from "+caller.getClass());
>}
This won't work for static methods because of the "this()" PCD.
Alternatively you can use

   thisEnclosingJoinPointStaticPart.getSignature().getDeclaringClass()

although it is less efficient than Ron's solution.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/



Back to the top