harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Pervov <pmcfi...@gmail.com>
Subject Re: About the jre classloader
Date Wed, 05 Aug 2009 08:58:44 GMT
...class loader of a class, executing new...

2009/8/5, Pavel Pervov <pmcfirst@gmail.com>:
> Hello, Tian.
> Thread context classloader is not used on new opcode. The initiating
> class loader of ClassType will be the class loader, which executes new
> instead. The defining loader will depend on the class being loaded and
> VM setup.
>
> 2009/8/5, galaxy <tian.galaxy@gmail.com>:
>> 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
View raw message