Re: Re: Instrumentation in native code

Andreas Sewe <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Organization Software Technology Group, Technisch e Universität Darmstadt
Message-ID <[email protected]>
> Prashant Deva wrote:
>> For example, we would like to add fields to the java.lang.Thread 
>> class. This can only be done through a native agent, since by the 
>> time the javaagent loads, the Thread class is already loaded and 
>> thus we cannot add fields to it.

Nikita Salnikov-Tarnovski wrote:
> Starting from java 6 you can retransform already loaded classes. See
> 
> http://download.oracle.com/javase/6/docs/api/java/lang/instrument/Instrumentation.html#retransformClasses(java.lang.Class...)

Unfortunately, class retransformation still doesn't allow you to *add*
fields or methods, which is something the OP asked about. :-(

But using ASM to transform rt.jar offline and then prepending things to
the boot class path works just fine.

Best wishes,

Andreas
message-footer.txt (text/plain, 238 B)
-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.