I am sort of new to Javassist and have a design question which has probably been already discussed. I couldn't search and look for the discussion though due to no search facility as far as I could see. Anyway, to state my question,
I don't know which instrumentation methods to choose for which situations when it comes to instrumenting many methods in an application during load time. I have 2 approaches in mind:
Approach 1 seems to be easier to implement and would perhaps use less resources - no new to create new methods for every instrumented method, no need to make 2 method calls for each original method call and no need for the JVM to store additional method information for the dummy method. We need to create local variables to store any state between insertBefore() and insertAfter() since we cannot access existing local variables and it is not wise to use instance variables for load time instrumentation.
Would love to hear your opinions. Thanks.