spring mvc (aop), can spring aspect or other way to get a method which intercepted where is it invoked? -
// public void testa(){ testb(); sayhello(); } // public void testb(){ sayhello(); } // private void sayhello() { }
my question is, when @aspect
use @around
intercept 3 methods (testa
, testb
, sayhello
). how can know sayhello()
invoked method (a or b) ?
try using reflection fetch stacktrace method called. need :
stacktraceelement[] stacktraceelements = thread.currentthread().getstacktrace();
javadocs :
the last element of array represents bottom of stack, least recent method invocation in sequence.
Comments
Post a Comment