Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 85702 invoked from network); 5 Aug 2009 08:59:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Aug 2009 08:59:07 -0000 Received: (qmail 68222 invoked by uid 500); 5 Aug 2009 08:59:13 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 68143 invoked by uid 500); 5 Aug 2009 08:59:13 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 68132 invoked by uid 99); 5 Aug 2009 08:59:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Aug 2009 08:59:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of pmcfirst@gmail.com designates 209.85.220.217 as permitted sender) Received: from [209.85.220.217] (HELO mail-fx0-f217.google.com) (209.85.220.217) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Aug 2009 08:59:05 +0000 Received: by fxm17 with SMTP id 17so3754870fxm.37 for ; Wed, 05 Aug 2009 01:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=m4+rzctnKYsVBgP9QiaD80LIZE9+7S7zxYlttNALcDg=; b=saEJJrgNsopynhSJDs1h7/nK4Os+tPomlXL6gxS3d1g+Eumn0kvx51Af15IAR6h0LP lkvV1oMMKrvZqJoo6lXuYI/+KK+rhoAWTclqdnlR0+6MgcjhzoqIR1pg2QtbtFvgXPAS M/EbhYwWOBG0gVH8usaIfmXnrhe6v/vxmihK0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=BbIHi+rIq3KqptxTgZt4O2TRAXu4zcOf1CFl5oT9ltJHbDLupVR9PIjPXiKcbnYAzD 9UfAzrhOHi85ZQh3biH0kn6HId8EY7V1qiZG1Y+OPAiwxEqMFswYcu9VkXPvMV+L3KUh Nn0IUrFypsI/UR8/iDPufhIOCWN3U+FMQmsyY= MIME-Version: 1.0 Received: by 10.102.247.10 with SMTP id u10mr77230muh.10.1249462724586; Wed, 05 Aug 2009 01:58:44 -0700 (PDT) In-Reply-To: References: Date: Wed, 5 Aug 2009 12:58:44 +0400 Message-ID: Subject: Re: About the jre classloader From: Pavel Pervov To: dev@harmony.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org ...class loader of a class, executing new... 2009/8/5, Pavel Pervov : > 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 : >> 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 >> >