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

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -