harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From galaxy <tian.gal...@gmail.com>
Subject About the jre classloader
Date Wed, 05 Aug 2009 07:41:23 GMT
Hi all
I have a question about the jre classloader .
In my work of jre osgi , I have to implement a new classloader to load the
classes since the
classloading mechanism is very different from the default one .
So I am thinking of the
Thread.currentThread().setContextClassloader(myclassloader),
but this is not very useful.
for example [1] , the stdout will print systemclassloader or null depends on
the class to load ..
So how to make sure that a " new ClassLoader " will use my classloader
instead of loading every one using myClassLoader.loadClass(String)

[1]
Thread.currentThread().setContextClassloader(myclassloader),
ClassType object = new ClassType();
system.out.println(object.getClass().getClassLoader())




-- 
regards
Tian

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message