You could use something like the following to get a stack trace
        Thread current = Thread.currentThread();
        StackTraceElement[] stack = current.getStackTrace();
        for ( StackTraceElement stackElement : stack )    {
            String className = stackElement.getClassName();
...
        }
You can use the className to match against the source location.
    





________________________________
From: Andrew Eisenberg <[email protected]>
To: [email protected]
Sent: Wed, 9 June, 2010 16:29:47
Subject: Re: [aspectj-users] How to get caller method name, little urgent.

There is no direct way to get the name of the calling method using
AspectJ.  The best solution is to look at
thisJoinPointStaticPart.getSourceLocation() and then map the resulting
location back to a method in the original text.


      
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to