Difference between redefineClasses and retransformClasses?
bastian.helfert at gmail.com
Mon May 19 09:43:16 PDT 2008
I re-read the API documentation for
*java.lang.instrument.Instrumentation*over and over again, but I could
not figure out what the (main) difference
is between the methods *redefineClasses* and *retransformClasses*.
Imagine I have multiple agents that (re)transform the bytecode of the same
class. By using *retransformClasses* the current definition of the class is
passed to the transform method.
But could not I also read the current class file bytes and instrument them,
e.g. by using a bytecode manipulation library, *before *I pass these bytes
Hence, what can I do with *retransformClasses* that I cannot also do with *
redefineClasses*? Or is *retransformClasses* actually "API sugar"? When
would I use what method?
Thank you very much in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the serviceability-dev