Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@apache.org Received: (qmail 35022 invoked from network); 6 Nov 2001 09:35:16 -0000 Received: from unknown (HELO osaka.betaversion.org) (192.18.49.133) by daedalus.apache.org with SMTP; 6 Nov 2001 09:35:16 -0000 Received: (qmail 21866 invoked from network); 6 Nov 2001 09:37:51 -0000 Received: from nagoya.betaversion.org (192.18.49.131) by osaka.betaversion.org with SMTP; 6 Nov 2001 09:37:50 -0000 Received: (qmail 2530 invoked by uid 97); 6 Nov 2001 09:35:24 -0000 Delivered-To: qmlist-jakarta-archive-avalon-dev@jakarta.apache.org Received: (qmail 2480 invoked by uid 97); 6 Nov 2001 09:35:22 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 2467 invoked from network); 6 Nov 2001 09:35:20 -0000 Message-ID: <3BE7AED1.7090607@yahoo.com> Date: Tue, 06 Nov 2001 09:35:13 +0000 From: Paul Hammant User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.5) Gecko/20011011 X-Accept-Language: en-us MIME-Version: 1.0 To: Avalon Developers List Subject: Re: Classloader thoughts? References: <00f801c15cc3$150aec20$650d07d8@STACCATO> <200110261215.f9QCFiJ30453@mail008.syd.optusnet.com.au> <015001c16292$102c23c0$22a5b5d8@glissando> <200111060508.fA658oJ11072@mail008.syd.optusnet.com.au> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Serge, > >In theory all the jars in blocks/ and lib/ directory should be loaded via the >same ClassLoader (However we experimented with a few things re ClassLoader a >bit back so that may have caused issues). So in theory you should be able to >do something like the following. > >BlockContext context = ...; >File homeDir = context.getHomeDirectory(); >File classesDir = new File( homeDir, "classes" ); >URL[] urls = new URL[] { classesDir.toURL() }; > >ClassLoader parent = James.class.getClassLoader(); > >URLClassLoader classloader = URLClassLoader.newInstance( urls, parent ); > >then in theory you should be able to load mailets/matchers out of this >classloader. You should also be able to throw it away later and reload it all >providing that all matchers/mailets are in classes/ directory. > I can vouch for this as it works for Jesktop like this. It you are using Fede's Store then you'll have to be careful with the classloader there too. - Paul -- To unsubscribe, e-mail: For additional commands, e-mail: