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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -