Currently I am working on a Java agent to assemble memory stats. With the help of the instrumentation API I can get a hold of the classes (and manipulate them). With plain J
I wonder if what you are trying to do might be accomplished using BTrace?