Thread information of intercepting method Spring AOP

789 views Asked by At

Is there a way to find out the thread information of the method which AOP intercepts, using some sort of around advice? E.g if my around advice is intercepting a login method, is there a way to obtain the information of the thread which is actually running the login method through classes like joinpointcut etc.? Thanks in advance.

1

There are 1 answers

2
Ralph On

use:

Thread.currentThread();

The static method java.lang.Thread.currentThread() returns a reference to the currently executing thread object.