Why is the setContextClassLoader() method placed on Thread ?
Posted
by Roman
on Stack Overflow
See other posts from Stack Overflow
or by Roman
Published on 2010-03-22T14:58:07Z
Indexed on
2010/03/22
15:01 UTC
Read the original article
Hit count: 354
java
|classloader
Why is the setContextClassLoader() method placed on thread ?
What different thread have different classloaders?
The question is what if i extended a classloader , loaded there some new classes. to the my custom classloader.
Now , I want it to be the context classloader , so I call the method (Thread.currentThread().setContextClassLoader(loader)).
Are these new classes awailable only in the context of the current Thread ? ( or how does it work ?)
Thanks
© Stack Overflow or respective owner