2009/7/31 Garth Sheldon-Coulson <g...@mit.edu>:
> Dear Clojurians,
>
> Is it possible to dynamically swap in a new classloader or give Clojure's 
> classloader a new parent classloader?
>
> I'm embedding Clojure in a parent app, and the parent app has its own 
> classloader that keeps track of its own classpath. It gives my embedded 
> Clojure a pretty meager classpath such that I can't import anything without 
> add-classpath'ing first.
>
> One option is to shuttle the parent classpath over to Clojure iteratively 
> using add-classpath. It would be better and more elegant, though, if I could 
> just link into the parent classloader directly.

Not exactly sure what you're referring to, or what exactly the layout
of your classloaders are, but classloaders are _in general_
hierarchical, with the parent having precedence. Meaning that if it's
on the parents classpath, then the parent classloader will load an
provide the class (that scheme is part of the security architecture
around the JVM to prevent unwanted code injection/manipulation).

If you're running in a container (appserver/servlet container/osgi
container/etc.), which is doing classloading tricks, then the answer
is going to be dependent on which container it is and how your app
fits in.

Cheers,
Daniel

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to