Classloaders are generally additive. The system classloader pulls in standard Java libraries and anything else you specify on the command line. Then you can add classloaders, and they delegate back to the parent classloader as a default behavior. When you want to get rid of the JAR references for a classloader, you throw the whole thing away and start new. Anything you want to save, you need to serialize and recreate.
There are ways to change the default behavior of classloaders, but you really have to know what you are doing or you'll get yourself into trouble. Before you go too far with a design, study up on how classloaders work. They really are almost magical, but there are limitations. If you use them correctly, you get incredible performance, and if you use them incorrectly, performance can be pretty poor. Plan to do lots of experimentation, and best of luck! On May 24, 9:06 am, Brent Millare <brent.mill...@gmail.com> wrote: > I am creating another dependency management system that using dynamic > compilation to load dependencies during runtime. My actual issue is I > needed to reconstruct the new effective classpath which should include > the classpath given (from (System/getProperty "java.class.path")) at > the commandline and the URLs given when the dependency management > loads new jars (.getURLs (.deref (clojure.lang.Compiler/LOADER))). I > suppose I don't need to maintain a reference to the many classloaders > if I simply maintain a listing of all URLs in something like a > reference, is that correct?. Also, I suppose the issue now is that in > the future when I may want to support unloading of classes to > facilitate faster startup of applications, like in the design of > nailgun, I would need to create explicit semantics that would need to > be used to unload classes because URLs would not automatically be > removed from my maintained reference, do you agree? > > Best, > Brent -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en