-
Feature Request
-
Resolution: Won't Do
-
Minor
-
None
-
None
-
None
-
High
-
Undefined
It would be very helpfull to inject an action in the entry point of a method, then another in the exit of the method, and share binding variables between both action
Here is 2 typical usages:
1/ compute endTime-startTime, and add logs or increments timing statistics
// DO ENTER code {{ long startTime = System.currentTimeMillis(); // }} try { .... the instrumented method } finally { // DO EXIT code {{ long elapsedMillis = System.currentTimeMillis() - startTime; log.info("executed method, took " + elapsedMillis + " ms"); // }} }
2/ push then pop values in a ThreadLocal object
// DO ENTER code {{ ThreadLocal someThreadLocal = ... Object prevValue = someThreadLocal.get(); someThreadLocal.set(somePushedValue); // }} try { .... the instrumented method } finally { // DO EXIT code {{ someThreadLocal.set(prevValue ); // }} }
In these 2 samples, it is not possible to use 2 different rules with "ENTER" and "EXIT" method, because we have to use a common "BINDING" between 2 blocks of code
Thank you very much for reading this Feature request, and for your excellent tool