Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 8163 invoked from network); 16 Jan 2008 18:39:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jan 2008 18:39:09 -0000 Received: (qmail 98713 invoked by uid 500); 16 Jan 2008 18:38:58 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 98673 invoked by uid 500); 16 Jan 2008 18:38:58 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 98664 invoked by uid 99); 16 Jan 2008 18:38:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jan 2008 10:38:58 -0800 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 heavy@ungoverned.org designates 69.89.17.209 as permitted sender) Received: from [69.89.17.209] (HELO outbound-mail-09.bluehost.com) (69.89.17.209) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 16 Jan 2008 18:38:32 +0000 Received: (qmail 5259 invoked by uid 0); 16 Jan 2008 18:38:37 -0000 Received: from unknown (HELO host118.hostmonster.com) (74.220.207.118) by mailproxy1.bluehost.com with SMTP; 16 Jan 2008 18:38:37 -0000 Received: from nat-02.eecs.tufts.edu ([130.64.23.202] helo=heavy.glastender.com) by host118.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1JFD9p-000867-Ht for dev@felix.apache.org; Wed, 16 Jan 2008 11:38:37 -0700 Message-ID: <478E4EF1.7090007@ungoverned.org> Date: Wed, 16 Jan 2008 13:37:37 -0500 From: "Richard S. Hall" User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: dev@felix.apache.org Subject: Re: ClassLoader.getResources() not overrided References: <478E2C1D.5060608@objectweb.org> <1200499969.23712.63.camel@bslm-046.corp.day.com> <478E3BBF.7060305@objectweb.org> <478E40BD.1010208@objectweb.org> In-Reply-To: <478E40BD.1010208@objectweb.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Identified-User: {1027:host118.hostmonster.com:ungovern:ungoverned.org} {sentby:smtp auth 130.64.23.202 authed with heavy@ungoverned.org} X-Virus-Checked: Checked by ClamAV on apache.org Guillaume Sauthier wrote: > After a bit of thinking, I was wondering if a possible solution could > be to have the ability to change the ContentClassLoader implementation. > > If something like this was present, I could have my own JDK5 only > ContentClassLoader that extends ContentClassLoader and override the > getResources method. > > What do you think ? > May I start to create a patch for that ? Certainly you can do that for your own project, but I am not sure how easily it could be integrated into Felix...this is a case where we could use #ifdef, I guess. :-) -> richard > > Thanks > --Guillaume > > Guillaume Sauthier wrote: >> Thanks for your input Felix >> That was not the answer I was expecting :) >> >> Anyway, do you have any idea about how to workaround this problem ? >> >> Thanks >> --Guillaume >> >> >> Felix Meschberger wrote: >>> Hi Guillaume, >>> >>> The problem with this method is, that upto and including Java 1.4 it is >>> marked final. It is not final anymore starting with Java 5.. So, the >>> ContentClassLoader cannot overwrite. >>> >>> Hope this helps. >>> >>> Regards >>> Felix >>> >>> Am Mittwoch, den 16.01.2008, 17:09 +0100 schrieb Guillaume Sauthier: >>> >>>> Hi team >>>> >>>> I've just noticed that the ContentClassLoader do not override the >>>> ClassLoader.getResources(String) method. >>>> It only override the ClassLoader.getResource(String method). Notice >>>> the final 's', one of theses methods is returning an Enumeration, >>>> not the other one. >>>> Moreover, the ISearchPolicy, that is used under the hood to find >>>> resources have a findResources(String):Enumeration method :) >>>> >>>> I expect getResources() to list resources available to the bundle >>>> (using OSGi constraints), not only "local" resources, which is the >>>> current behavior. >>>> >>>> This is probably something forgotten :) >>>> Can you enlight me ? Is this normal, or not ? >>>> >>>> Cheers >>>> --Guillaume >>>> >>> >>> >>> >> >