You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by Konglish Khan <pe...@yahoo.com> on 2004/01/23 05:39:20 UTC

How to replace the system's class loader?

Hi everyone, I've recently started working with the bcel libraries, nothing serious yet, but I plan to develop a program that will make good use of them. I just have a problem I haven't figured out yet. On the "Manual" section of the BCEL site (http://jakarta.apache.org/bcel/manual.html), Introduction, second paragraph, I read:
 
"One can write a plug-in replacement for the system's class loader which is responsible for dynamically loading class files at run-time and passing the byte code to the Virtual Machine (see section ). Class loaders may thus be used to intercept the loading process and transform classes before they get actually executed by the JVM. While the original class files always remain unaltered, the behavior of the class loader may be reconfigured for every execution or instrumented dynamically."
 
 
I do agree that making changes at load-time seems to be the right thing to do, so I want to do certain analysis and transformations at that stage.
The problem I have is I don't know how could one replace the system's class loader. Say I'm using or intend to use the JVM , how may I replace its class loader?
 
Does anyone know?
 
 
Thanks a lot for any reply in advance.
 
Martin


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!