What I want to do is instrument users' code as it is loaded --
even if it's loaded by its own classloaders.

I don't care where the code comes from (file, url, rmi, byte stream,
etc.), I just want my chance to instrument it.

Now as I see it, what I *think* I should do is to replace a
low-level definition of defineClass(), which will then see every
class as a byte array as its loaded. But...

This implies that I'll need to hack the core Java libraries to
get to the proper classloader. Or maybe worse? I have to change
the JVM's primordial classloader? Just changing the System
classloader isn't enough, because people can avoid it. 

And BCEL has no interface for reading a byte array and turning
it into a javaClass (does it?). Using the Repository methods
won't work with arbitrary classloaders (will it?).




Others have probably thought about this before. Can you give me
direction on how to do this?

Thanks,


-Bil Lewis




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to